This commit is contained in:
Kostiantyn Stoliarskyi 2023-05-26 15:37:43 +03:00
parent 14b4ce2ff5
commit 443b4000fc
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class NewUserForm(FlaskForm):
class EditUserForm(FlaskForm):
name = StringField("Name", [DataRequired()])
avatar_img = FileField("Avatar file (max 1mb)")
avatar_img = FileField("Avatar file (max 1mb, formats: jpg,jpeg,png)")
submit = SubmitField("Save")
def validate_username(self, field):

View File

@ -42,7 +42,7 @@
</div>
<div>
{{form.avatar_img(type='file', class='bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500', id="avatar_img",
{{form.avatar_img(type='file', class='bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500', id="avatar_img", accept=".jpg,.png,.jpeg",
value=current_user.avatar_img if current_user.avatar_img else "")}}</div>
</div>
<button type="submit" class="w-full px-5 py-3 text-base font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 sm:w-auto dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Save changes</button>