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

Same Discount Code is not able to be applied for two different events #6027

Closed
kushthedude opened this issue Jun 7, 2019 · 15 comments · Fixed by #6208

Comments

@kushthedude
Copy link
Contributor

@kushthedude kushthedude commented Jun 7, 2019

Describe the bug

Currently if you create two same discount codes for two events , You will see it is invalid for one of the event

To Reproduce

Steps to reproduce the behavior:

  • Create Discount Code X for Event A
  • Create Discount Code X for Event B
  • Apply X to B
  • See Error

Expected behavior

Same Discount Should be able to apply

Screenshot

Screenshot 2019-06-07 at 5 49 25 PM

@kushthedude kushthedude changed the title Same Discount Code is not able to be applied for two differents Same Discount Code is not able to be applied for two different events Jun 7, 2019
@kushthedude

This comment has been minimized.

Copy link
Contributor Author

@kushthedude kushthedude commented Jun 9, 2019

@uds5501 @shreyanshdwivedi Can you check reproducibility ?

@uds5501 uds5501 self-assigned this Jun 9, 2019
@uds5501

This comment has been minimized.

Copy link
Contributor

@uds5501 uds5501 commented Jun 9, 2019

@uds5501 Yes it is. I will take a look at it.

@CosmicCoder96 CosmicCoder96 transferred this issue from fossasia/open-event-frontend Jun 11, 2019
@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jun 11, 2019

@uds5501 In case you are busy, can I take this one up.

@uds5501

This comment has been minimized.

Copy link
Contributor

@uds5501 uds5501 commented Jun 11, 2019

@prateekj117 please feel free to do so, ask @kushthedude to assign you this issue

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jun 29, 2019

@uds5501 @kushthedude I am not able to face this issue, instead of going request to 'discount-code', the request goes to 'access-code', which makes me wonder what's the difference between them. The issue does not exist if there are two same 'access-codes' for different events.

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jun 30, 2019

@mrsaicharan1 @shreyanshdwivedi Your views on this?

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jul 13, 2019

@uds5501 @iamareebjamal @mrsaicharan1 Here the problem is, we query discount code only by its name, and event_id is not passed in params.
So there is no way to query it using event. What should be the way to go about it?

@iamareebjamal

This comment has been minimized.

Copy link
Member

@iamareebjamal iamareebjamal commented Jul 13, 2019

Paste the query here

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jul 13, 2019

@iamareebjamal
discount = db.session.query(DiscountCode).filter_by(code=kwargs.get('code'), deleted_at=None).first()

@iamareebjamal

This comment has been minimized.

Copy link
Member

@iamareebjamal iamareebjamal commented Jul 13, 2019

we query discount code only by its name, and event_id is not passed in params.

The query browser is making

discount = db.session.query(DiscountCode).filter_by(code=kwargs.get('code'), deleted_at=None).first()

That's really really bad

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jul 13, 2019

@iamareebjamal I checked the kwargs, event_id is not being passed from frontend as well.

@kushthedude

This comment has been minimized.

Copy link
Contributor Author

@kushthedude kushthedude commented Jul 13, 2019

The query browser is making

?

@iamareebjamal

This comment has been minimized.

Copy link
Member

@iamareebjamal iamareebjamal commented Jul 13, 2019

@prateekj117 That's why I asked, what query is coming from frontend?

@prateekj117

This comment has been minimized.

Copy link
Member

@prateekj117 prateekj117 commented Jul 13, 2019

@iamareebjamal

This comment has been minimized.

Copy link
Member

@iamareebjamal iamareebjamal commented Jul 13, 2019

Change the access code accessor to /event/<event-id>/access-code/<access-code-id> as it should have been

Change to be done in both server and client.

This is a high priority change. So don't take a lot of time please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.