Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
site-kwei
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
mediatek
site-kwei
Commits
dcd4b641
Commit
dcd4b641
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Minor code cleanup
parent
dbc4f4a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
accounts/views.py
+5
-4
5 additions, 4 deletions
accounts/views.py
home/views.py
+0
-1
0 additions, 1 deletion
home/views.py
interludes/settings.py
+2
-7
2 additions, 7 deletions
interludes/settings.py
with
7 additions
and
12 deletions
accounts/views.py
+
5
−
4
View file @
dcd4b641
from
django.conf
import
settings
from
django.contrib
import
messages
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.auth
import
login
,
logout
from
django.contrib.auth.views
import
LoginView
as
DjangoLoginView
from
django.contrib.sites.shortcuts
import
get_current_site
from
django.http
import
Http404
from
django.utils.encoding
import
force_bytes
,
force_text
from
django.utils.encoding
import
force_bytes
from
django.utils.http
import
urlsafe_base64_encode
,
urlsafe_base64_decode
from
django.urls
import
reverse
from
django.template.loader
import
render_to_string
...
...
@@ -32,6 +31,7 @@ class LogoutView(RedirectView):
messages
.
info
(
self
.
request
,
"
Vous avez bien été déconnecté·e.
"
)
return
super
().
get_redirect_url
(
*
args
,
**
kwargs
)
class
CreateAccountView
(
View
):
"""
Vue pour la creation de compte
"""
form_class
=
CreateAccountForm
...
...
@@ -78,8 +78,9 @@ class CreateAccountView(View):
return
redirect
(
'
accounts:login
'
)
class
ActivateAccountView
(
RedirectView
):
class
ActivateAccountView
(
RedirectView
):
"""
Vue d
'
activation de compte (lien envoyé par mail)
"""
permanent
=
False
def
get_redirect_url
(
self
,
uidb64
,
token
,
*
args
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
home/views.py
+
0
−
1
View file @
dcd4b641
from
django.conf
import
settings
from
django.contrib.sitemaps
import
Sitemap
from
django.shortcuts
import
redirect
,
render
from
django.urls
import
reverse
...
...
This diff is collapsed.
Click to expand it.
interludes/settings.py
+
2
−
7
View file @
dcd4b641
...
...
@@ -132,13 +132,8 @@ USE_TZ = True
STATIC_URL
=
'
/static/
'
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'
static
'
)
LOGIN_REDIRECT_URL
=
'
home
'
# Blocks account creation when false
REGISTRATION_USER_CREATION_OPEN
=
True
# Blocks event inscription
REGISTRATION_EVENT_INSCRIPTIONS_OPEN
=
True
LOGIN_URL
=
"
accounts:login
"
LOGIN_REDIRECT_URL
=
"
home
"
# This will display email in Console.
EMAIL_BACKEND
=
'
django.core.mail.backends.console.EmailBackend
'
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