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

Permitir comprar mas consumibles en vista de acceso a mentorships #1232

Merged
merged 13 commits into from
Jan 23, 2024

Conversation

gustavomm19
Copy link
Contributor

if plan_financing is not None:
user_plans = plan_financing.plans.all()

for plan in user_plans:
Copy link
Collaborator

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()
Copy link
Collaborator

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)
Copy link
Collaborator

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

Copy link
Collaborator

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()

Copy link
Collaborator

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

@jefer94 jefer94 merged commit eba8ca7 into breatheco-de:development Jan 23, 2024
8 of 12 checks passed
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.

2 participants