-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8748 from rtibbles/user_auth_redirect
Do permanent redirect from /user to /auth.
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
This is here to enable redirects from the old /user endpoint to /auth | ||
""" | ||
from django.conf.urls import include | ||
from django.conf.urls import url | ||
from django.views.generic.base import RedirectView | ||
|
||
from kolibri.core.device.translation import i18n_patterns | ||
|
||
redirect_patterns = [ | ||
url( | ||
r"^user/$", | ||
RedirectView.as_view( | ||
pattern_name="kolibri:kolibri.plugins.user_auth:user_auth", permanent=True | ||
), | ||
name="redirect_user", | ||
), | ||
] | ||
|
||
urlpatterns = [url(r"", include(i18n_patterns(redirect_patterns)))] |