diff --git a/app/views/book/settings.py b/app/views/book/settings.py index 9dd49f0..488814e 100644 --- a/app/views/book/settings.py +++ b/app/views/book/settings.py @@ -51,6 +51,10 @@ def add_contributor(book_id: int): form = f.AddContributorForm() selected_tab = "user_permissions" if form.validate_on_submit(): + user_id = form.user_id.data + # notifications + contributor_notification(m.Notification.Actions.CONTRIBUTING, book_id, user_id) + # ------------- response = add_contributor_to_book(form, book_id, selected_tab) return response else: @@ -77,6 +81,10 @@ def delete_contributor(book_id: int): selected_tab = "user_permissions" if form.validate_on_submit(): + user_id = form.user_id.data + # notifications + contributor_notification(m.Notification.Actions.DELETE, book_id, user_id) + # ------------- response = delete_contributor_from_book(form, book_id, selected_tab) return response else: diff --git a/migrations/versions/ad0ed27f417f_entity_id.py b/migrations/versions/ad0ed27f417f_entity_id.py index 61011c9..729c6db 100644 --- a/migrations/versions/ad0ed27f417f_entity_id.py +++ b/migrations/versions/ad0ed27f417f_entity_id.py @@ -10,23 +10,23 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = 'ad0ed27f417f' -down_revision = '3d45df38ffa9' +revision = "ad0ed27f417f" +down_revision = "3d45df38ffa9" branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('notifications', schema=None) as batch_op: - batch_op.add_column(sa.Column('entity_id', sa.Integer(), nullable=False)) + with op.batch_alter_table("notifications", schema=None) as batch_op: + batch_op.add_column(sa.Column("entity_id", sa.Integer(), nullable=False)) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - with op.batch_alter_table('notifications', schema=None) as batch_op: - batch_op.drop_column('entity_id') + with op.batch_alter_table("notifications", schema=None) as batch_op: + batch_op.drop_column("entity_id") # ### end Alembic commands ###