Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
piks3l
Respect My Net
Commits
de51a7db
Commit
de51a7db
authored
Sep 30, 2011
by
stef
Browse files
[fix] activated can't display what was activated :(
parent
2803e38c
Changes
1
Hide whitespace changes
Inline
Side-by-side
bt/views.py
View file @
de51a7db
...
...
@@ -49,7 +49,7 @@ def activate(request):
try
:
v
=
Violation
.
objects
.
get
(
activationid
=
request
.
GET
.
get
(
'key'
,
'asdf'
))
except
:
return
HttpResponse
(
_
(
'Thank you, this key has been already activated'
%
v
.
id
))
return
HttpResponse
(
_
(
'Thank you, this key has been already activated'
))
if
v
:
actid
=
hashlib
.
sha1
(
''
.
join
([
chr
(
randint
(
32
,
122
))
for
x
in
range
(
12
)])).
hexdigest
()
to
=
[
x
.
email
for
x
in
User
.
objects
.
filter
(
groups__name
=
'moderator'
)]
...
...
@@ -92,7 +92,7 @@ def moderate(request):
pass
v
.
activationid
=
''
v
.
save
()
return
HttpResponseRedirect
(
'/
'
)
# Redirect after POST
return
HttpResponseRedirect
(
'/
view/%s'
%
v
.
id
)
# Redirect after POST
if
request
.
GET
.
get
(
'action'
,
''
)
==
'delete'
:
v
.
delete
()
messages
.
add_message
(
request
,
messages
.
INFO
,
_
(
'Thank you for deleting the submission.'
))
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment