mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
fix crash when there are no topics
This commit is contained in:
parent
6d2ddb92fa
commit
c1961c41c3
1 changed files with 2 additions and 1 deletions
|
@ -639,7 +639,8 @@ def community_edit(community_id: int):
|
|||
community.image = file
|
||||
|
||||
db.session.commit()
|
||||
community.topic.num_communities = community.topic.communities.count()
|
||||
if community.topic:
|
||||
community.topic.num_communities = community.topic.communities.count()
|
||||
db.session.commit()
|
||||
flash(_('Saved'))
|
||||
return redirect(url_for('activitypub.community_profile', actor=community.ap_id if community.ap_id is not None else community.name))
|
||||
|
|
Loading…
Add table
Reference in a new issue