Исправлена ошибка фотографии профиля

This commit is contained in:
mrmur 2022-05-01 15:25:06 +05:00
parent 5cf1bf9fde
commit a4ded16d12
4 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -181,6 +181,7 @@ def edit_profile(logins):
photo = None
if form.del_photo.data:
help_arg = photo
ph_f = False
photo = '../static/img/None_logo.png'
if form.submit2.data:
user = session.query(User).filter(User.login == logins).first()
@ -198,6 +199,7 @@ def edit_profile(logins):
if help_arg:
os.remove(help_arg)
help_arg = False
photo = '../static/img/None_logo.png'
user.photo = photo
session.commit()
if user.email == form.email.data:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

View File

@ -52,7 +52,7 @@
</div>
{% endfor %}
</div>
{% if ph_f %}
{% if ph_f == 1 %}
{{ form.del_photo(type="submit", class="btn btn-primary") }}
{% for error in form.del_photo.errors %}
<div class="alert alert-danger" role="alert">