Commit 152eba89 authored by Raniere Silva's avatar Raniere Silva
Browse files

Merge remote-tracking branch 'swc-styles/gh-pages' into gh-pages

parents 48c893dc 23a98275
...@@ -205,13 +205,20 @@ def check_helpers(helpers): ...@@ -205,13 +205,20 @@ def check_helpers(helpers):
@look_for_fixme @look_for_fixme
def check_email(email): def check_email(email):
""" """
'email' must be a valid email address consisting of characters, 'email' must be a comma-separated list of valid email addresses.
an '@', and more characters. It should not be the default contact The list may be empty. A valid email address consists of characters,
email address ''. an '@', and more characters. It should not contain the default contact
""" """
return bool(re.match(EMAIL_PATTERN, email)) and \ # YAML automatically loads list-like strings as lists.
(email != DEFAULT_CONTACT_EMAIL) if (isinstance(emails, list) and len(emails) >= 0):
for email in emails:
if ((not bool(re.match(EMAIL_PATTERN, email))) or (email == DEFAULT_CONTACT_EMAIL)):
return False
return False
return True
def check_eventbrite(eventbrite): def check_eventbrite(eventbrite):
...@@ -286,8 +293,9 @@ HANDLERS = { ...@@ -286,8 +293,9 @@ HANDLERS = {
'helper list isn\'t a valid list of format ' + 'helper list isn\'t a valid list of format ' +
'["First helper", "Second helper",..]'), '["First helper", "Second helper",..]'),
'email': (True, check_email, 'email': (True, check_emails,
'contact email invalid or still set to ' + 'contact email list isn\'t a valid list of format ' +
'["", "",..] or contains incorrectly formatted email addresses or ' +
'"{0}".'.format(DEFAULT_CONTACT_EMAIL)), '"{0}".'.format(DEFAULT_CONTACT_EMAIL)),
'eventbrite': (False, check_eventbrite, 'Eventbrite key appears invalid'), 'eventbrite': (False, check_eventbrite, 'Eventbrite key appears invalid'),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment