0.7.66
profile change photo
This commit is contained in:
@@ -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):
|
||||
# #
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user