Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
2173d4bb
Commit
2173d4bb
authored
Feb 23, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #117 from jdcaballero/master
Email field in signup form
parents
80790d51
c96d656a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
wiki/forms.py
+7
-0
wiki/views/accounts.py
+4
-4
No files found.
wiki/forms.py
View file @
2173d4bb
...
@@ -18,6 +18,7 @@ from wiki.core.diff import simple_merge
...
@@ -18,6 +18,7 @@ from wiki.core.diff import simple_merge
from
django.forms.widgets
import
HiddenInput
from
django.forms.widgets
import
HiddenInput
from
wiki.core.plugins.base
import
PluginSettingsFormMixin
from
wiki.core.plugins.base
import
PluginSettingsFormMixin
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.contrib.auth.forms
import
UserCreationForm
from
wiki.core
import
permissions
from
wiki.core
import
permissions
class
SpamProtectionMixin
():
class
SpamProtectionMixin
():
...
@@ -400,3 +401,9 @@ class SearchForm(forms.Form):
...
@@ -400,3 +401,9 @@ class SearchForm(forms.Form):
query
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'placeholder'
:
_
(
u'Search...'
),
query
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'placeholder'
:
_
(
u'Search...'
),
'class'
:
'search-query'
}),
required
=
False
)
'class'
:
'search-query'
}),
required
=
False
)
class
UserCreationForm
(
UserCreationForm
):
email
=
forms
.
EmailField
(
required
=
True
)
class
Meta
:
model
=
User
fields
=
(
"username"
,
"email"
)
wiki/views/accounts.py
View file @
2173d4bb
...
@@ -5,7 +5,7 @@ go ahead and replace it or disable it!"""
...
@@ -5,7 +5,7 @@ go ahead and replace it or disable it!"""
from
django.conf
import
settings
as
django_settings
from
django.conf
import
settings
as
django_settings
from
django.contrib
import
messages
from
django.contrib
import
messages
from
django.contrib.auth
import
logout
as
auth_logout
,
login
as
auth_login
from
django.contrib.auth
import
logout
as
auth_logout
,
login
as
auth_login
from
django.contrib.auth.forms
import
AuthenticationForm
,
UserCreationForm
from
django.contrib.auth.forms
import
AuthenticationForm
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
...
@@ -13,12 +13,13 @@ from django.utils.translation import ugettext as _
...
@@ -13,12 +13,13 @@ from django.utils.translation import ugettext as _
from
django.views.generic.base
import
View
from
django.views.generic.base
import
View
from
django.views.generic.edit
import
CreateView
,
FormView
from
django.views.generic.edit
import
CreateView
,
FormView
from
wiki
import
forms
from
wiki.models
import
URLPath
from
wiki.models
import
URLPath
from
wiki.conf
import
settings
from
wiki.conf
import
settings
class
Signup
(
CreateView
):
class
Signup
(
CreateView
):
model
=
User
model
=
User
form_class
=
UserCreationForm
form_class
=
forms
.
UserCreationForm
template_name
=
"wiki/accounts/signup.html"
template_name
=
"wiki/accounts/signup.html"
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
...
@@ -78,4 +79,4 @@ class Login(FormView):
...
@@ -78,4 +79,4 @@ class Login(FormView):
if
not
self
.
referer
:
if
not
self
.
referer
:
return
redirect
(
'wiki:get'
,
path
=
''
)
return
redirect
(
'wiki:get'
,
path
=
''
)
return
redirect
(
self
.
referer
)
return
redirect
(
self
.
referer
)
\ No newline at end of file
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