-
Notifications
You must be signed in to change notification settings - Fork 2
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
🐛(backend) generate certificates with product type certificate #1065
Open
jonathanreveille
wants to merge
3
commits into
main
Choose a base branch
from
bug/bulk_certification_generation_joanie_django_admin_fails
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🐛(backend) generate certificates with product type certificate #1065
jonathanreveille
wants to merge
3
commits into
main
from
bug/bulk_certification_generation_joanie_django_admin_fails
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b1dc0fa
to
2582167
Compare
bcda62c
to
4842912
Compare
d0192f4
to
fdeaf46
Compare
It is now possible to launch the generation of certificates for orders with product of type certificate from the BO. Fix #1063
Since we have fixed the generation of certificates into the BO for orders with product type certificate, we don't want our admin users to use the django admin anymore for this task. We decided to remove the action from the admin courses, products and orders views. It is now impossible to generate certificate through the django admin views. Fix #1061
fdeaf46
to
b3eaa19
Compare
jbpenrath
reviewed
Feb 26, 2025
Comment on lines
33
to
37
Q(order__course=course_product_relation.course, order__enrollment__isnull=True) | ||
| Q(order__course__isnull=True, order__enrollment__isnull=False), | ||
order__product=course_product_relation.product, | ||
order__course=course_product_relation.course, | ||
order__certificate__isnull=False, | ||
order__state=ORDER_STATE_COMPLETED, |
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.
Something is wrong here as you will try to generate certificate for all completed certificate products.
You have to filter per enrollment__course_run__course
in case of certificate product
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
We have fixed the generation of certificates for orders with product of type certificate from the BO. It was missing a filter queryset to get all the orders that are with product type certificate (has enrollment and no course).
Since we only want the admin users to use the BO to generate certificates (because it uses celery to launch the task in background), we have decided to remove the action to generate certificates through the django admin views (course, product, and order). The reason why through django admin the users would get a Server Error 500 is because the generation takes a while.
Proposal