Changeset 6560b8f in OpenWorkouts-current
- Timestamp:
- Dec 16, 2018, 1:32:35 AM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- f24ad73
- Parents:
- 1d92bf2
- Location:
- ow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/schemas/user.py
r1d92bf2 r6560b8f 71 71 weight = validators.Number() 72 72 gender = validators.OneOf(('male', 'female'), not_empty=True) 73 picture = FieldStorageBlob(whitelist=['jpg', 'jpeg', 'png', 'gif']) 73 picture = FieldStorageBlob(if_emtpy=None, if_missing=None, 74 whitelist=['jpg', 'jpeg', 'png', 'gif']) 74 75 75 76 -
ow/views/user.py
r1d92bf2 r6560b8f 144 144 renderer='ow:templates/edit_profile.pt') 145 145 def edit_profile(context, request): 146 # if not given a file there is an empty byte in POST, which breaks 147 # our blob storage validator. 148 # dirty fix until formencode fixes its api.is_empty method 149 if isinstance(request.POST.get('picture', None), bytes): 150 request.POST['picture'] = '' 151 146 152 form = Form(request, schema=UserProfileSchema(), obj=context) 153 147 154 if 'submit' in request.POST and form.validate(): 148 155 # No picture? do not override it
Note: See TracChangeset
for help on using the changeset viewer.