Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove custom __init__ from discount coupon, use uuid from coaster #161

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions boxoffice/models/discount_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from itsdangerous import Signer, BadSignature
from sqlalchemy import event, DDL
from baseframe import __
from coaster.utils import LabeledEnum, uuid1mc, buid
from coaster.utils import LabeledEnum, buid
from boxoffice.models import db, IdMixin, BaseScopedNameMixin
from boxoffice.models import Organization

Expand Down Expand Up @@ -126,10 +126,6 @@ class DiscountCoupon(IdMixin, db.Model):
__uuid_primary_key__ = True
__table_args__ = (db.UniqueConstraint('discount_policy_id', 'code'),)

def __init__(self, *args, **kwargs):
self.id = uuid1mc()
super(DiscountCoupon, self).__init__(*args, **kwargs)

code = db.Column(db.Unicode(100), nullable=False, default=generate_coupon_code)
usage_limit = db.Column(db.Integer, nullable=False, default=1)
used_count = db.Column(db.Integer, nullable=False, default=0)
Expand Down