Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-account
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
djangoldp-packages
djangoldp-account
Commits
1e26aca5
Commit
1e26aca5
authored
4 years ago
by
Sylvain Llop
Browse files
Options
Downloads
Patches
Plain Diff
update: redirect to default
parent
7a22f49e
No related branches found
No related tags found
2 merge requests
!91
Django registration simple
,
!90
update: redirect to default
Pipeline
#10283
passed
4 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
djangoldp_account/views.py
+3
-2
3 additions, 2 deletions
djangoldp_account/views.py
with
3 additions
and
2 deletions
djangoldp_account/views.py
+
3
−
2
View file @
1e26aca5
...
@@ -3,7 +3,7 @@ from django.views import View
...
@@ -3,7 +3,7 @@ from django.views import View
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth.views
import
LoginView
,
SuccessURLAllowedHostsMixin
from
django.contrib.auth.views
import
LoginView
,
SuccessURLAllowedHostsMixin
from
django.shortcuts
import
redirect
,
render
from
django.shortcuts
import
redirect
,
render
from
django.urls
import
reverse
from
django.urls
import
reverse
,
reverse_lazy
from
django.utils.http
import
(
from
django.utils.http
import
(
is_safe_url
,
urlsafe_base64_decode
,
is_safe_url
,
urlsafe_base64_decode
,
)
)
...
@@ -169,6 +169,7 @@ class LDPAccountRegistrationView(SuccessURLAllowedHostsMixin, RegistrationView):
...
@@ -169,6 +169,7 @@ class LDPAccountRegistrationView(SuccessURLAllowedHostsMixin, RegistrationView):
def
register
(
self
,
form
):
def
register
(
self
,
form
):
from
django.conf
import
settings
from
django.conf
import
settings
if
getattr
(
settings
,
'
SIMPLE_REGISTRATION
'
,
False
):
if
getattr
(
settings
,
'
SIMPLE_REGISTRATION
'
,
False
):
self
.
success_url
=
reverse_lazy
(
"
redirect-default
"
)
new_user
=
form
.
save
()
new_user
=
form
.
save
()
new_user
=
authenticate
(
new_user
=
authenticate
(
**
{
**
{
...
@@ -181,7 +182,7 @@ class LDPAccountRegistrationView(SuccessURLAllowedHostsMixin, RegistrationView):
...
@@ -181,7 +182,7 @@ class LDPAccountRegistrationView(SuccessURLAllowedHostsMixin, RegistrationView):
sender
=
self
.
__class__
,
user
=
new_user
,
request
=
self
.
request
sender
=
self
.
__class__
,
user
=
new_user
,
request
=
self
.
request
)
)
return
new_user
return
new_user
return
super
.
register
(
form
)
return
super
()
.
register
(
form
)
class
RPLoginView
(
View
):
class
RPLoginView
(
View
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment