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

Unique coupon code in org and assignee email in item #295

Merged
merged 14 commits into from
Aug 1, 2019

Conversation

iambibhas
Copy link
Contributor

@iambibhas iambibhas commented Jul 17, 2019

This has 2 fixes -

  1. a quickfix for checking unique coupon code in an organization instead of a discount policy. It relates to Uniqueness of coupon code #290.
  2. a validation for unique assignee email inside an item so that multiple attendees cannot use same email address.

Explanation for change in how discounts are looked up:

Previously it was searching for other instances of the same code being used in the same discount policy. I changed it to look inside the same organization until we figure out how to do it within the same item collection. Right now there is no relationship between a discount policy and an item collection, and discount coupons are created within an organization, and not an item collection.

@iambibhas iambibhas requested review from jace and vidya-ram July 17, 2019 05:19
boxoffice/models/discount_policy.py Show resolved Hide resolved
DiscountCoupon.code == field.data
)
.notempty()
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I get the difference between these two queries. Explain it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously it was searching for other instances of the same code being used in the same discount policy. I changed it to look inside the same organization until we figure out how to do it within the same item collection. Right now there is no relationship between a discount policy and an item collection, and discount coupons are created within an organization, and not an item collection. Hence this.

boxoffice/views/participant.py Outdated Show resolved Hide resolved
Copy link
Member

@jace jace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple small issues and then good to merge.

boxoffice/views/participant.py Outdated Show resolved Hide resolved
boxoffice/views/participant.py Outdated Show resolved Hide resolved
@jace
Copy link
Member

jace commented Jul 22, 2019

@qurbat this one is for you.

Bibhas and others added 6 commits July 30, 2019 08:56
@iambibhas iambibhas merged commit a97af60 into master Aug 1, 2019
@iambibhas iambibhas deleted the fix-coupon-code branch August 1, 2019 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants