Skip to content

Commit

Permalink
πŸ› error handling vip models πŸ—ƒοΈ (#7184)
Browse files Browse the repository at this point in the history
  • Loading branch information
matusdrobuliak66 authored Feb 7, 2025
1 parent eee4eb2 commit 70e88e8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"""licensed items checkout/purchase email mandatory
Revision ID: 611f956aa3e3
Revises: e71ea59858f4
Create Date: 2025-02-07 12:47:56.235193+00:00
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "611f956aa3e3"
down_revision = "e71ea59858f4"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"resource_tracker_licensed_items_checkouts",
"user_email",
existing_type=sa.VARCHAR(),
nullable=False,
)
op.alter_column(
"resource_tracker_licensed_items_purchases",
"user_email",
existing_type=sa.VARCHAR(),
nullable=False,
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"resource_tracker_licensed_items_purchases",
"user_email",
existing_type=sa.VARCHAR(),
nullable=True,
)
op.alter_column(
"resource_tracker_licensed_items_checkouts",
"user_email",
existing_type=sa.VARCHAR(),
nullable=True,
)
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
sa.Column(
"user_email",
sa.String,
nullable=True,
nullable=False,
),
sa.Column("product_name", sa.String, nullable=False, doc="Product name"),
sa.Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
sa.Column(
"user_email",
sa.String,
nullable=True,
nullable=False,
),
sa.Column(
"purchased_at",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ProjectAlreadyStartedError(BaseBackEndError):


class InsufficientNumberOfSeatsError(BaseBackEndError):
msg_template = "Not enough available seats. Current available seats {num_of_seats} for license item {licensed_item_id}"
msg_template = "Not enough available seats for license item {licensed_item_id}"
status_code = status.HTTP_409_CONFLICT


Expand Down

0 comments on commit 70e88e8

Please sign in to comment.