fix crash when there are no topics

This commit is contained in:
rra 2024-03-26 17:16:51 +01:00
parent 6d2ddb92fa
commit c1961c41c3

View file

@ -639,6 +639,7 @@ def community_edit(community_id: int):
community.image = file
db.session.commit()
if community.topic:
community.topic.num_communities = community.topic.communities.count()
db.session.commit()
flash(_('Saved'))