comparison MoinMoin/action/newaccount.py @ 3122:a1322262398a

refactored _() getText calls to match new api
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 27 Feb 2008 00:23:46 +0100
parents ed1a433803c6
children 2a3a6cb34e45
comparison
equal deleted inserted replaced
3121:ca1c60a5285c 3122:a1322262398a
18 def _create_user(request): 18 def _create_user(request):
19 _ = request.getText 19 _ = request.getText
20 form = request.form 20 form = request.form
21 21
22 if request.request_method != 'POST': 22 if request.request_method != 'POST':
23 return _("Use UserPreferences to change your settings or create an account.") 23 return _("Use UserPreferences to change your settings or create an account.", wiki=True)
24 24
25 if not TextCha(request).check_answer_from_form(): 25 if not TextCha(request).check_answer_from_form():
26 return _('TextCha: Wrong answer! Go back and try again...', formatted=False) 26 return _('TextCha: Wrong answer! Go back and try again...')
27 27
28 # Create user profile 28 # Create user profile
29 theuser = user.User(request, auth_method="new-user") 29 theuser = user.User(request, auth_method="new-user")
30 30
31 # Require non-empty name 31 # Require non-empty name
36 36
37 # Don't allow creating users with invalid names 37 # Don't allow creating users with invalid names
38 if not user.isValidName(request, theuser.name): 38 if not user.isValidName(request, theuser.name):
39 return _("""Invalid user name {{{'%s'}}}. 39 return _("""Invalid user name {{{'%s'}}}.
40 Name may contain any Unicode alpha numeric character, with optional one 40 Name may contain any Unicode alpha numeric character, with optional one
41 space between words. Group page name is not allowed.""") % wikiutil.escape(theuser.name) 41 space between words. Group page name is not allowed.""", wiki=True) % wikiutil.escape(theuser.name)
42 42
43 # Name required to be unique. Check if name belong to another user. 43 # Name required to be unique. Check if name belong to another user.
44 if user.getUserId(request, theuser.name): 44 if user.getUserId(request, theuser.name):
45 return _("This user name already belongs to somebody else.") 45 return _("This user name already belongs to somebody else.")
46 46
131 name="email"))) 131 name="email")))
132 132
133 row = html.TR() 133 row = html.TR()
134 tbl.append(row) 134 tbl.append(row)
135 row.append(html.TD().append(html.STRONG().append( 135 row.append(html.TD().append(html.STRONG().append(
136 html.Text(_('TextCha (required)', formatted=False))))) 136 html.Text(_('TextCha (required)')))))
137 td = html.TD() 137 td = html.TD()
138 textcha = TextCha(request).render() 138 textcha = TextCha(request).render()
139 if textcha: 139 if textcha:
140 td.append(textcha) 140 td.append(textcha)
141 row.append(td) 141 row.append(td)