0.7.66
profile change photo
This commit is contained in:
@@ -29,6 +29,9 @@ class RegistrationForm(forms.Form):
|
|||||||
tel = forms.CharField()
|
tel = forms.CharField()
|
||||||
agreement = forms.BooleanField(initial=False, required=True)
|
agreement = forms.BooleanField(initial=False, required=True)
|
||||||
|
|
||||||
|
# def clean(self):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# # class PersonForm(NgModelFormMixin, NgFormValidationMixin, NgModelForm, Bootstrap3ModelForm):
|
# # class PersonForm(NgModelFormMixin, NgFormValidationMixin, NgModelForm, Bootstrap3ModelForm):
|
||||||
# #
|
# #
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ def change_avatar_confirm_ajax(request):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
data = json.loads(request.body)
|
file_data = json.loads(request.body)
|
||||||
file_data = json.loads(data[0])
|
|
||||||
head, content = file_data['file'].split(',')
|
head, content = file_data['file'].split(',')
|
||||||
content = base64.b64decode(content)
|
content = base64.b64decode(content)
|
||||||
file = ContentFile(content)
|
file = ContentFile(content)
|
||||||
@@ -99,6 +98,8 @@ def change_profile_confirm_ajax(request):
|
|||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
data = request.POST
|
data = request.POST
|
||||||
|
if not data:
|
||||||
|
data = json.loads(request.body)
|
||||||
|
|
||||||
from .forms import RegistrationForm
|
from .forms import RegistrationForm
|
||||||
form = RegistrationForm(data)
|
form = RegistrationForm(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user