-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
def validate_detail_value(ctx, value): | ||
if ctx.name == 'irc': | ||
if re.match(irc_regex, value) is None: | ||
raise ValueError("irc nick must be alphanumeric") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
irc nick can have _
and []
and -
(looking at the nick on #fedora) so we might need to adjust the regex here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, {
, }
, and ^
at least are allowed too.
According to this stackoverflow answer, this beast of a regex should work:
/\A[a-z_\-\[\]\\^{}|
][a-z0-9_-[]\^{}|]*\z/i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks!
def validate_detail_value(ctx, value): | ||
if ctx.name == 'irc': | ||
if re.match(irc_regex, value) is None: | ||
raise ValueError("value must be a valid irc nick") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea: do we want to log what was the suggestion? (a way of finding issues w/ our regex?) or include it in the error message?
👍 then :) |
…l-value Feature/comma delimited detail value
These changes make it so a user can have more than one email address, more than one irc nick, and most importantly, more than one android device.