bug when editing post

This commit is contained in:
rimu 2024-03-24 20:58:25 +13:00
parent c0f526d70f
commit 5c5c28a4a3

View file

@ -136,9 +136,10 @@ class CreatePostForm(FlaskForm):
current_user.reputation -= 1 current_user.reputation -= 1
db.session.commit() db.session.commit()
return False return False
community = Community.query.get(self.communities.data) if self.communities:
if community.is_local() and g.site.allow_local_image_posts is False: community = Community.query.get(self.communities.data)
self.communities.errors.append(_('Images cannot be posted to local communities.')) if community.is_local() and g.site.allow_local_image_posts is False:
self.communities.errors.append(_('Images cannot be posted to local communities.'))
elif self.post_type.data == 'poll': elif self.post_type.data == 'poll':
self.discussion_title.errors.append(_('Poll not implemented yet.')) self.discussion_title.errors.append(_('Poll not implemented yet.'))
return False return False