SE-4287 Fix for CRI-223

Description

<!--
Please give the pull request a short but descriptive title.
Use [conventional commits](https://www.conventionalcommits.org/) to separate and summarize commits logically.

Use this template as a guide. Omit sections that don't apply. You may link to information rather than copy it.
More details about the template are at https://github.com/edx/open-edx-proposals/pull/180
(link will be updated when that document merges)
-->

  1.  

    1. Description

In CMS > Course > Settings > Grading page (/settings/grading/<course-id>)
when language is changed, the reloaded page gives a 500 error.

This happens because Django language view:

```
url(r'^i18n/', include('django.conf.urls.i18n')),
```

adding None to the end of url for patterns like this:

```
url(fr'^settings/grading/{settings.COURSE_KEY_PATTERN}(/)?(?P<grader_index>\d+)?$',
contentstore_views.grading_handler, name='grading_handler'),
```

```
url(fr'^course_team/{COURSELIKE_KEY_PATTERN}(?:/(?P<email>.+))?$',
contentstore_views.course_team_handler, name='course_team_handler'),
```

```
url(fr'^assets/{settings.COURSE_KEY_PATTERN}/{settings.ASSET_KEY_PATTERN}?$',
contentstore_views.assets_handler,
name='assets_handler'),
```

e.g result will be for example `/course_team/course-v1:edX+DemoX+Demo_Course/None`

I'm sure that this is not correct behaviour and also the grading page triggers a 500 error because of the used pattern.

![image](https://user-images.githubusercontent.com/3278913/112875887-72951380-90cd-11eb-8767-f802f7a65345.png)

  1.  

    1. Supporting information

Jira Ticket: [SE-4287](https://tasks.opencraft.com/browse/SE-4287)

(https://openedx.atlassian.net/browse/CRI-223)

  1.  

    1. Testing instructions

*Steps to Reproduce*
1. Header language selector should be enabled
2. You should have more than 1 language enabled (in django admin > Darklang Configuration
3. Choose a existing course and go to Settings > Grading
4. Change language using the language dropdown in the header and wait for the page reload.
5. Language is updated but the reloaded page gives an error.

  • To enable language select add to your settings:
    ```
    SHOW_HEADER_LANGUAGE_SELECTOR = True
    FEATURES['SHOW_HEADER_LANGUAGE_SELECTOR'] = True
    ```
    To your settings.

  1.  

    1. Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

  1.  

    1. Other information

I tried to split urls like:
```
url(fr'^settings/grading/{settings.COURSE_KEY_PATTERN}', include([
url(r'^$', contentstore_views.grading_handler, name='grading_handler'),
url(fr'^(?P<grader_index>\d+)?$', contentstore_views.grading_handler, name='grading_handler_id')
])),
```

But this is requires a lot of changes on backend

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Open Source Pull Request Bot

Contributor Name

Artem Hruzd

Repo

edx/edx-platform

Customer

Github Lines Added

0

Github Lines Deleted

0