diff --git a/app/admin/routes.py b/app/admin/routes.py index 5fce6f0f..7445ef23 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -339,10 +339,16 @@ def admin_topics(): @permission_required('administer all communities') def admin_topic_add(): form = EditTopicForm() + form.add_community.choices = communities_for_form() if form.validate_on_submit(): topic = Topic(name=form.name.data, num_communities=0) db.session.add(topic) db.session.commit() + if form.add_community.data: + community = Community.query.get(form.add_community.data) + community.topic_id = topic.id + topic.num_communities += 1 + db.session.commit() flash(_('Saved')) return redirect(url_for('admin.admin_topics')) diff --git a/app/post/routes.py b/app/post/routes.py index 4d204fce..996327c6 100644 --- a/app/post/routes.py +++ b/app/post/routes.py @@ -817,7 +817,7 @@ def post_reply_edit(post_id: int, comment_id: int): return redirect(url_for('activitypub.post_ap', post_id=post.id)) else: form.body.data = post_reply.body - form.notify_author.data = not post_reply.notify_author + form.notify_author.data = post_reply.notify_author return render_template('post/post_reply_edit.html', title=_('Edit comment'), form=form, post=post, post_reply=post_reply, comment=comment, markdown_editor=True, moderating_communities=moderating_communities(current_user.get_id()), joined_communities=joined_communities(current_user.get_id()))