FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
patchwork/patchwork/views/notification.py at main · getpatchwork/patchwork · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
getpatchwork
/
patchwork
Public
Notifications
You must be signed in to change notification settings
Fork
90
Star
315
Code
Issues
97
Pull requests
22
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
patchwork
/
patchwork
/
views
/
notification.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (30 loc) · 1.07 KB
Breadcrumbs
patchwork
/
patchwork
/
views
/
notification.py
Copy path
File metadata and controls
38 lines (30 loc) · 1.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
# Copyright (C) 2016 Stephen Finucane <stephenfinucane@hotmail.com>
#
# SPDX-License-Identifier: GPL-2.0-or-later
from
django
.
http
import
Http404
from
django
.
shortcuts
import
get_object_or_404
from
django
.
shortcuts
import
render
from
patchwork
.
models
import
EmailConfirmation
from
patchwork
.
views
import
mail
from
patchwork
.
views
import
user
def
confirm
(
request
,
key
):
views
=
{
'userperson'
:
user
.
link_confirm
,
'registration'
:
user
.
register_confirm
,
'optout'
:
mail
.
optout_confirm
,
'optin'
:
mail
.
optin_confirm
,
}
conf
=
get_object_or_404
(
EmailConfirmation
,
key
=
key
)
if
conf
.
type
not
in
views
:
raise
Http404
if
conf
.
active
and
conf
.
is_valid
():
return
views
[
conf
.
type
](
request
,
conf
)
context
=
{}
context
[
'conf'
]
=
conf
if
not
conf
.
active
:
context
[
'error'
]
=
'inactive'
elif
not
conf
.
is_valid
():
context
[
'error'
]
=
'expired'
return
render
(
request
,
'patchwork/confirm-error.html'
,
context
)
Back
|
FazBrowse Home
|
New Git URL