diff --git a/AuthApp/forms.py b/AuthApp/forms.py index b61fc9d..87f51cf 100644 --- a/AuthApp/forms.py +++ b/AuthApp/forms.py @@ -29,6 +29,9 @@ class RegistrationForm(forms.Form): tel = forms.CharField() agreement = forms.BooleanField(initial=False, required=True) + # def clean(self): + + # # class PersonForm(NgModelFormMixin, NgFormValidationMixin, NgModelForm, Bootstrap3ModelForm): # # diff --git a/AuthApp/js_views.py b/AuthApp/js_views.py index 3f5629f..034b7b3 100644 --- a/AuthApp/js_views.py +++ b/AuthApp/js_views.py @@ -77,8 +77,7 @@ def change_avatar_confirm_ajax(request): try: - data = json.loads(request.body) - file_data = json.loads(data[0]) + file_data = json.loads(request.body) head, content = file_data['file'].split(',') content = base64.b64decode(content) file = ContentFile(content) @@ -99,6 +98,8 @@ def change_profile_confirm_ajax(request): raise Http404 data = request.POST + if not data: + data = json.loads(request.body) from .forms import RegistrationForm form = RegistrationForm(data)