Merge branch 'develop' into svyat/feat/book_version

This commit is contained in:
SvyatoslavArtymovych 2023-06-15 10:40:03 +03:00
commit 8d9dc8fb8b
2 changed files with 14 additions and 6 deletions

View File

@ -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:

View File

@ -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 ###