Opened 7 years ago
Closed 7 years ago
#13222 closed defect (fixed)
String Formating "%s" output in user creation error
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | low | Component: | AccountManagerPlugin |
Severity: | minor | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description (last modified by )
Hi,
If i try to create a user account and the account isn't compatible with the regexp policy, an error message is shown. In this error message the string formatting field %s
is displayed, not the username who should be created.
Attachments (0)
Change History (8)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 7 years ago by
This appears to be an error in [12384/accountmanagerplugin/trunk/acct_mgr/register.py]. The message args are stored in msg_args
, but nothing is done with them. I'm unsure why a noop translation marker needs to be used in this case. The following patch might be sufficient:
-
acct_mgr/register.py
313 313 req.args.get('username', '').strip()) 314 314 if req.path_info != '/prefs' and self.username_regexp != '' and \ 315 315 not re.match(self.username_regexp.strip(), username): 316 raise RegistrationError( N_(317 "Username % s doesn't match local naming policy."),318 tag.b(username)319 ) 316 raise RegistrationError(tag_( 317 "Username %(username)s doesn't match local naming policy.", 318 username=tag.b(username) 319 )) 320 320 321 321 email = req.args.get('email', '').strip() 322 322 if self.env.is_enabled(EmailCheck) and \
Similar changes likely need to be made elsewhere in the module.
comment:5 Changed 7 years ago by
Since [16680], _("revoked")
and _('pending')
are passed to set_user_attribute()
. Those localized revoked and pending would be stored in session_attribute.value
column.
I consider we should localize the values when displaying on browser and console rather than storing localized values.
comment:6 Changed 7 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:7 Changed 7 years ago by
Status: | reopened → accepted |
---|
Providing the actual error message would be useful.