misc: set profile image file selector to suggest image files (#27646)
This commit is contained in:
parent
ace8072025
commit
c4bf1137af
|
@ -258,3 +258,8 @@ class ProfileImageInput(ClearableFileInput):
|
|||
)
|
||||
else:
|
||||
template_name = "authentic2/profile_image_input.html"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
attrs = kwargs.pop('attrs', {})
|
||||
attrs['accept'] = 'image/*'
|
||||
super(ProfileImageInput, self).__init__(*args, attrs=attrs, **kwargs)
|
||||
|
|
|
@ -442,3 +442,8 @@ def test_profile_image(db, app, admin, mailoutbox, media):
|
|||
assert image.width == 200
|
||||
assert image.height == 200
|
||||
assert john().attributes.cityscape_image.name != profile_filename
|
||||
|
||||
# verify file input mentions image files
|
||||
response = app.get('/accounts/edit/')
|
||||
form = response.form
|
||||
assert form['edit-profile-cityscape_image'].attrs['accept'] == 'image/*'
|
||||
|
|
Loading…
Reference in New Issue