Исправлена ошибка вопросов
This commit is contained in:
parent
9daa4d9f09
commit
6cb2bf47b6
6
main.py
6
main.py
@ -133,6 +133,7 @@ def main_page():
|
||||
emotion['is_like'] = 1
|
||||
emotion_you_like_that.append(emotion)
|
||||
quest = session.query(Answer).filter(Answer.user == current_user.id).all()
|
||||
try:
|
||||
days_reg = current_user.data_reg - datetime.date.today()
|
||||
days_reg = abs(days_reg.days) + 1
|
||||
if quest:
|
||||
@ -154,6 +155,8 @@ def main_page():
|
||||
ans2 = {}
|
||||
for i in ans:
|
||||
ans2[i.id_question] = i
|
||||
except Exception:
|
||||
ans2 = []
|
||||
else:
|
||||
you_like_that = []
|
||||
emotion_you_like_that = None
|
||||
@ -663,6 +666,7 @@ def diary():
|
||||
emotion['link'] = None
|
||||
lis_emotion.append(emotion)
|
||||
quest = db_sess.query(Answer).filter(Answer.user == current_user.id).all()
|
||||
try:
|
||||
days_reg = current_user.data_reg - datetime.date.today()
|
||||
days_reg = abs(days_reg.days) + 1
|
||||
if quest:
|
||||
@ -684,6 +688,8 @@ def diary():
|
||||
ans2 = {}
|
||||
for i in ans:
|
||||
ans2[i.id_question] = i
|
||||
except Exception:
|
||||
ans2 = []
|
||||
else:
|
||||
posts = None
|
||||
post_quest = None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user