These are chat archives for fossasia/open-event-server

4th
Jul 2018
Saurabh Chaturvedi
@schedutron
Jul 04 2018 12:08
For discount code, the schema is always DiscountCodeSchemaEvent no matter whether it's used for eventor ticket before posting.
Saurabh Chaturvedi
@schedutron
Jul 04 2018 12:15
Since the before_post method is not really called "before" but in between the actual post function in flask-rest-jsonapi, the code to change schema based on the value of used-for attribute of discount codes doesn't really work.
So even if I post a discount code of type ticket, it's schema remains DiscountCodeSchemaEvent instead of DiscountCodeSchemaTicket.
To fix this, should I create a new method decide_schema()of ResourceList that does this part?
Saurabh Chaturvedi
@schedutron
Jul 04 2018 12:28
Need this for #4911