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!: upgrade get_issued_certificates to DRF ( 24 ) #35534

Merged
merged 9 commits into from
Nov 25, 2024

Conversation

awais786
Copy link
Contributor

@awais786 awais786 commented Sep 25, 2024

Issue

Testing step via postman

  1. Use this URL in postman for post

expected result

{
    "certificates": [
        {
            "course_id": "course-v1:edx+cs201+2023",
            "mode": "audit",
            "total_issued_certificate": 1,
            "report_run_date": "September 25, 2024"
        }
    ],
    "queried_features": [
        "course_id",
        "mode",
        "total_issued_certificate",
        "report_run_date"
    ],
    "feature_names": {
        "course_id": "CourseID",
        "mode": "Certificate Type",
        "total_issued_certificate": "Total Certificates Issued",
        "report_run_date": "Date Report Run"
    }
}

You can pass the ?csv=false or ?csv=true to get the csv file.


Test via dashboard.
Enable waffle flag = instructor.enable_data_download_v2

  1. Go to this page user your course id.
  2. select certificate tab.
Screenshot 2024-09-25 at 12 30 37 PM

This works with POST and GET both.

@awais786 awais786 changed the title Get issued certificates to drf feat!: upgrade get_issued_certificates to DRF Sep 25, 2024
@awais786 awais786 marked this pull request as ready for review September 25, 2024 08:12
@awais786 awais786 changed the title feat!: upgrade get_issued_certificates to DRF feat!: upgrade get_issued_certificates to DRF ( 24 ) Sep 25, 2024
common method for both post and get. This method will return all issued certificates.
"""
course_key = CourseKey.from_string(course_id)
csv_required = request.GET.get('csv', 'false')
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be available if we're calling with the POST method? Also, it seems like the original implementation does not provide POST why are we adding POST support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@feanil, the previous code did not restrict any HTTP methods, so both GET and POST were functioning when tested via Postman. However, only the POST method is implemented on the front-end.

@awais786 awais786 merged commit 8ea2d10 into master Nov 25, 2024
51 checks passed
@awais786 awais786 deleted the get_issued_certificates-to-drf branch November 25, 2024 11:05
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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.

4 participants