-
Notifications
You must be signed in to change notification settings - Fork 42
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
Permitir comprar mas consumibles en vista de acceso a mentorships #1232
Conversation
if plan_financing is not None: | ||
user_plans = plan_financing.plans.all() | ||
|
||
for plan in user_plans: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This for
has not sense here
return render_message(request, str(e), status=402) | ||
from breathecode.payments.models import Subscription, PlanOffer, PlanFinancing | ||
|
||
context = build_context() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are unused
context = build_context()
context, args, kwargs = consumer(context, args, kwargs)
|
||
renovate_consumables = {} | ||
url = request.path | ||
match = re.search(r'service/(.*)', url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This decorator is generic, you cannot use it just for mentorship purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should use something inside the consumer method to deal with it
subscription = Subscription.objects.filter( | ||
user=request.user, | ||
plans__mentorship_service_set__mentorship_services__slug=service).first() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only works with mentorship services and it should fail if the consumer
has custom rules of comsuption, causing a message error related to consumables within a resource that was marked as free for users with that permission
breatheco-de/breatheco-de#6270