Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
013bebd1
Commit
013bebd1
authored
Dec 24, 2013
by
Jean Michel Rouly
Browse files
Process signup data and store it in a temporary file for now.
parent
58107183
Changes
1
Hide whitespace changes
Inline
Side-by-side
go/go/views.py
View file @
013bebd1
from
go.models
import
URL
,
RegisteredUser
from
go.forms
import
URLForm
,
SignupForm
from
datetime
import
timedelta
from
django.conf
import
settings
from
django.http
import
Http404
from
django.utils
import
timezone
from
django.contrib.auth.models
import
User
from
django.core.exceptions
import
PermissionDenied
from
django.contrib.auth.decorators
import
login_required
from
django.shortcuts
import
render
,
get_object_or_404
,
redirect
import
os
def
is_registered
(
user
):
try
:
...
...
@@ -118,7 +120,18 @@ def signup(request):
username
=
form
.
cleaned_data
.
get
(
'username'
)
full_name
=
form
.
cleaned_data
.
get
(
'full_name'
)
description
=
form
.
cleaned_data
.
get
(
'description'
)
pass
f
=
open
(
os
.
path
.
join
(
settings
.
MEDIA_ROOT
,
'registrations.txt'
),
'a'
)
f
.
write
(
str
(
timezone
.
now
())
)
f
.
write
(
str
(
'
\n
'
)
)
f
.
write
(
str
(
username
)
)
f
.
write
(
str
(
'
\n
'
)
)
f
.
write
(
str
(
full_name
)
)
f
.
write
(
str
(
'
\n
'
)
)
f
.
write
(
str
(
description
)
)
f
.
write
(
str
(
'
\n\n\n
'
)
)
f
.
close
()
return
redirect
(
'index'
)
return
render
(
request
,
'signup.html'
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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