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

feat: adding enrollment receiver #91

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Conversation

andrey-canon
Copy link
Collaborator

Description

This will create external certificates when a user enrolls in a course, generally that certificate will have a grade of 0 and then that will be updated by the certificate_publisher

https://edunext.atlassian.net/browse/FUTUREX-488

Testing instructions

  1. Set ENABLE_CERTIFICATE_PUBLISHER to True
  2. Save a course enrollment in the admin panel, then check logs. Change the course enrollment mode to get different logs

the beginning of the course, then the certificate receiver will update the grade.

Args:
instance<CourseEnrollment>: This an instance of the model CourseEnrollment.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Here I have some doubt in some signal we uses instance in other the name of the instance.
https://github.com/eduNEXT/eox-nelp/pull/91/files#diff-51a002e5f9d204c9c4fb523f904e54043838095b1a1a2b498d768d5f2d09cb43R70

So instead of instance is not easier course_enrollment ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that names depends on how the signal is emitted

)

create_external_certificate.delay(
external_certificate_data=_generate_external_certificate_data(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I found a problem if I create an enrollment from scratch.
Maybe the certificate doesn't exist and resolves
Peek 2023-08-31 15-15
with 500.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, the good new is that you found a line that is not necessary

- create_external_certificate is called with the _generate_external_certificate_data output.
- Info was logged.
"""
generate_data_mock.return_value = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also as above, this is mocked so t when this doesn't exist the process turns into an error.

Copy link
Collaborator

@johanseto johanseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little typo to improve in tests but with the change It seems the bug was removed.

cut

I think id was something good to keep, but no way it could be extracted using the reference_id I think.

@data(*WRONG_NATIONAL_IDS)
def test_invalid_mational_id(self, wrong_national_id, generate_certificate_mock, passing_mock):
def test_invalid_mational_id(self, wrong_national_id, passing_mock):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_invalid_mational_id(self, wrong_national_id, passing_mock):
def test_invalid_national_id(self, wrong_national_id, passing_mock):

@johanseto johanseto self-requested a review September 1, 2023 14:33
This will create external certificates when a user enrolls in a course, generally that certificate will have a grade of 0 and then that will be updated by the certificate_publisher

https://edunext.atlassian.net/browse/FUTUREX-488
@andrey-canon andrey-canon merged commit ddb73bb into master Sep 4, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants