Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Feature/comma delimited detail value #2

Merged
merged 7 commits into from
Jan 20, 2014

Conversation

ralphbean
Copy link
Contributor

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.

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")
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

Copy link
Member

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

Copy link
Contributor Author

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")
Copy link
Member

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?

@pypingou
Copy link
Member

👍 then :)

ralphbean added a commit that referenced this pull request Jan 20, 2014
…l-value

Feature/comma delimited detail value
@ralphbean ralphbean merged commit 1d434f2 into develop Jan 20, 2014
@ralphbean ralphbean deleted the feature/comma-delimited-detail-value branch January 20, 2014 16:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants