Skip to content

Commit

Permalink
Define database relationship from order to storefront
Browse files Browse the repository at this point in the history
This fixes an error on attempting order cancelation when called from a script.
  • Loading branch information
homeworkprod committed Mar 26, 2024
1 parent 707bb3e commit 8da6785
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions byceps/services/shop/order/dbmodels/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from byceps.services.shop.order.models.number import OrderNumber
from byceps.services.shop.order.models.order import OrderID, PaymentState
from byceps.services.shop.shop.models import ShopID
from byceps.services.shop.storefront.dbmodels import DbStorefront
from byceps.services.shop.storefront.models import StorefrontID
from byceps.services.user.dbmodels.user import DbUser
from byceps.services.user.models.user import UserID
Expand All @@ -44,6 +45,7 @@ class DbOrder(db.Model):
db.ForeignKey('shop_storefronts.id'),
index=True,
)
storefront: Mapped[DbStorefront] = relationship(DbStorefront)
order_number: Mapped[OrderNumber] = mapped_column(
db.UnicodeText, unique=True
)
Expand Down

0 comments on commit 8da6785

Please sign in to comment.