-
Notifications
You must be signed in to change notification settings - Fork 17
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
Warn/block member from buying lab membership if person does not have yearly membership #179
Comments
How is this currently handled on the key extension side? Will the key automatically be extended even the person doesn't have a yearly membership? |
Yes, it will be extended regardless of yearly membership status. |
Hasn't this been fixed with @HalfVoxel changes with subscriptions? |
@BerglundDaniel It has not been fixed yet, I was able to purchase one month of lab access without a base membership. Will take this one to fix |
Correction: it is possible to buy labaccess without base membership, but once it is done, there will be a warning saying that the person needs to buy the base membership. The lab access subscription will not start until that is done, so that is nice. Is that fine or do we want to make other changes here? |
If you want to do this, the relevant thing to do would be to add a filter: https://github.com/makerspace/makeradmin/blob/master/api/src/shop/filters.py |
Looking at the code, filters are applied per product, so if we don't allow buying lab access when there is no active base membership, we will also disallow buying them both at the same time 😢 Alternative is to check if there is an attempt to purchase lab access without a base membership, which can be done once the function processes all products in the cart individually |
Right. That makes sense. Annoying. Probably why there's no filter already :p |
Best solution would probably be to sort out #207 first. If the cart is on backend, we can validate contents earlier, before payment is attempted |
You can validate contents at the same time as the filters are run anyway. They are run on the backend. |
Yes, that is the best place for now. I will put it there, and it can be moved with the cart later. |
Current behaviour
Member can buy yearly membership and lab membership independently of each other.
Wanted behaviour
Member should be warned or blocked from buying lab membership if they do not have active yearly membership
The text was updated successfully, but these errors were encountered: