credentials icon indicating copy to clipboard operation
credentials copied to clipboard

fix: download records without Segment setup

Open dyudyunov opened this issue 3 years ago • 4 comments

Fix the download records functionality when Segment is not used.

The user is getting the error if the platform has no Segment settings.

Preconditions

  • The segment_key setting in the credentials site configurations is empty

STR

  1. Go to the records page, click "Share" and copy the sharing URL: Screenshot 2022-08-19 at 15 11 28
  2. Open the copied URL in the new tab or incognito window and click "Download": Screenshot 2022-08-19 at 15 12 48

Actual Result User see the 500 error: Screenshot 2022-08-19 at 15 20 42 Error logs:

Traceback (most recent call last):
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/edx/app/credentials/credentials/credentials/apps/records/views.py", line 56, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
return handler(request, *args, **kwargs)
File "/edx/app/credentials/credentials/credentials/apps/records/views.py", line 478, in get
segment_client = SegmentClient(write_key=site_configuration.segment_key)
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/analytics/client.py", line 60, in init
require('write_key', write_key, string_types)
File "/edx/app/credentials/venvs/credentials/lib/python3.8/site-packages/analytics/client.py", line 325, in require
raise AssertionError(msg)
AssertionError: write_key must have (<class 'str'>,), got: None

Expecting Result The user (or anonymous user) can download the CSV report.

Notes:

  • Segment key is not the mandatory setting in the credentials site configuration

dyudyunov avatar Aug 19 '22 12:08 dyudyunov

Thanks for the pull request, @dyudyunov! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

openedx-webhooks avatar Aug 19 '22 12:08 openedx-webhooks

@natabene this one is ready for review 😉

dyudyunov avatar Aug 19 '22 12:08 dyudyunov

@dyudyunov Thank you for your contribution. I will line up this for our review.

natabene avatar Aug 19 '22 13:08 natabene

@hurtstotouchfire Hi Kelly! Could you please take a look at this?

mphilbrick211 avatar Oct 26 '22 01:10 mphilbrick211

This is in our next sprint, starting Monday. If it's approved within the 2 week sprint it can be merged. @dyudyunov if you can be available to respond to any review feedback during the next week or so that would be very helpful.

hurtstotouchfire avatar Dec 02 '22 23:12 hurtstotouchfire

This is in our next sprint, starting Monday. If it's approved within the 2 week sprint it can be merged. @dyudyunov if you can be available to respond to any review feedback during the next week or so that would be very helpful.

Sure

dyudyunov avatar Dec 05 '22 07:12 dyudyunov

@dyudyunov 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

openedx-webhooks avatar Jan 03 '23 21:01 openedx-webhooks