Email address is now completely optional during signup.
This commit is contained in:
parent
1d89b83cf0
commit
2831d56db5
|
@ -161,7 +161,7 @@ class Users( object ):
|
||||||
username = ( Valid_string( min = 1, max = 30 ), valid_username ),
|
username = ( Valid_string( min = 1, max = 30 ), valid_username ),
|
||||||
password = Valid_string( min = 1, max = 30 ),
|
password = Valid_string( min = 1, max = 30 ),
|
||||||
password_repeat = Valid_string( min = 1, max = 30 ),
|
password_repeat = Valid_string( min = 1, max = 30 ),
|
||||||
email_address = ( Valid_string( min = 1, max = 60 ), valid_email_address ),
|
email_address = ( Valid_string( min = 0, max = 60 ) ),
|
||||||
signup_button = unicode,
|
signup_button = unicode,
|
||||||
)
|
)
|
||||||
def signup( self, username, password, password_repeat, email_address, signup_button ):
|
def signup( self, username, password, password_repeat, email_address, signup_button ):
|
||||||
|
@ -192,6 +192,12 @@ class Users( object ):
|
||||||
if user is not None:
|
if user is not None:
|
||||||
raise Signup_error( u"Sorry, that username is not available. Please try something else." )
|
raise Signup_error( u"Sorry, that username is not available. Please try something else." )
|
||||||
|
|
||||||
|
if len( email_address ) > 0:
|
||||||
|
try:
|
||||||
|
email_address = valid_email_address( email_address )
|
||||||
|
except ValueError:
|
||||||
|
raise Validation_error( "email_address", email_address, valid_email_address )
|
||||||
|
|
||||||
# create a notebook for this user, along with a trash for that notebook
|
# create a notebook for this user, along with a trash for that notebook
|
||||||
trash_id = self.__database.next_id( Notebook, commit = False )
|
trash_id = self.__database.next_id( Notebook, commit = False )
|
||||||
trash = Notebook.create( trash_id, u"trash" )
|
trash = Notebook.create( trash_id, u"trash" )
|
||||||
|
|
|
@ -82,6 +82,28 @@ class Test_users( Test_controller ):
|
||||||
|
|
||||||
assert result[ u"redirect" ].startswith( u"/notebooks/" )
|
assert result[ u"redirect" ].startswith( u"/notebooks/" )
|
||||||
|
|
||||||
|
def test_signup_without_email_address( self ):
|
||||||
|
result = self.http_post( "/users/signup", dict(
|
||||||
|
username = self.new_username,
|
||||||
|
password = self.new_password,
|
||||||
|
password_repeat = self.new_password,
|
||||||
|
email_address = u"",
|
||||||
|
signup_button = u"sign up",
|
||||||
|
) )
|
||||||
|
|
||||||
|
assert result[ u"redirect" ].startswith( u"/notebooks/" )
|
||||||
|
|
||||||
|
def test_signup_with_invalid_email_address( self ):
|
||||||
|
result = self.http_post( "/users/signup", dict(
|
||||||
|
username = self.new_username,
|
||||||
|
password = self.new_password,
|
||||||
|
password_repeat = self.new_password,
|
||||||
|
email_address = u"foo@",
|
||||||
|
signup_button = u"sign up",
|
||||||
|
) )
|
||||||
|
|
||||||
|
assert u"error" in result
|
||||||
|
|
||||||
def test_current_after_signup( self ):
|
def test_current_after_signup( self ):
|
||||||
result = self.http_post( "/users/signup", dict(
|
result = self.http_post( "/users/signup", dict(
|
||||||
username = self.new_username,
|
username = self.new_username,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<h3>password reset</h3>
|
<h3>password reset</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If you can't remember your username or password, just enter your email
|
If you can't remember your username or password, just enter the email address
|
||||||
address and you'll receive a link to reset your password. You'll also get a
|
you gave during sign up, and you'll receive a link to reset your password.
|
||||||
username reminder.
|
You'll also get a username reminder.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -2,12 +2,18 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To get started with your own personal wiki, all you need to do is sign up for
|
To get started with your own personal wiki, all you need to do is sign up for
|
||||||
an account. There's nothing to download or install.
|
an account. <b>There's nothing to download or install.</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
I ask for your email address in case you need your password reset. I hate spam,
|
If you haven't seen it already, <a href="/users/demo" target="_top">try the
|
||||||
and wouldn't even dream of giving out your email address.
|
demo</a> first! The Luminotes demo doesn't require any sort of sign up.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<b>Providing your email address is completely optional.</b> I only ask for it
|
||||||
|
in case you ever need your password reset. Your email address will absolutely
|
||||||
|
not be given out or used for spam.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form id="signup_form">
|
<form id="signup_form">
|
||||||
|
@ -27,7 +33,7 @@ and wouldn't even dream of giving out your email address.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<b>email address</b><br />
|
<b>email address (optional)</b><br />
|
||||||
<input type="text" name="email_address" id="email_address" class="text_field" size="30" maxlength="60" />
|
<input type="text" name="email_address" id="email_address" class="text_field" size="30" maxlength="60" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,3 @@ Luminotes features, at least currently:
|
||||||
<li>Konqueror</li>
|
<li>Konqueror</li>
|
||||||
<li>Lynx</li>
|
<li>Lynx</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
If you're looking for a personal wiki with more minimal browser requirements,
|
|
||||||
you might want to try <a href="http://tiddlywiki.com/"
|
|
||||||
target="_top">TiddlyWiki</a>. And for a more general-purpose wiki, check out
|
|
||||||
<a href="http://moinmoin.wikiwikiweb.de/" target="_top">MoinMoin</a>.
|
|
||||||
|
|
Reference in New Issue