Loading bin/workshop_check.py +15 −7 Original line number Diff line number Diff line Loading @@ -205,13 +205,20 @@ def check_helpers(helpers): @look_for_fixme def check_email(email): """ 'email' must be a valid email address consisting of characters, an '@', and more characters. It should not be the default contact email address 'admin@software-carpentry.org'. 'email' must be a comma-separated list of valid email addresses. The list may be empty. A valid email address consists of characters, an '@', and more characters. It should not contain the default contact """ return bool(re.match(EMAIL_PATTERN, email)) and \ (email != DEFAULT_CONTACT_EMAIL) # YAML automatically loads list-like strings as lists. 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 else: return False return True def check_eventbrite(eventbrite): Loading Loading @@ -286,8 +293,9 @@ HANDLERS = { 'helper list isn\'t a valid list of format ' + '["First helper", "Second helper",..]'), 'email': (True, check_email, 'contact email invalid or still set to ' + 'email': (True, check_emails, 'contact email list isn\'t a valid list of format ' + '["me@example.org", "you@example.org",..] or contains incorrectly formatted email addresses or ' + '"{0}".'.format(DEFAULT_CONTACT_EMAIL)), 'eventbrite': (False, check_eventbrite, 'Eventbrite key appears invalid'), Loading Loading
bin/workshop_check.py +15 −7 Original line number Diff line number Diff line Loading @@ -205,13 +205,20 @@ def check_helpers(helpers): @look_for_fixme def check_email(email): """ 'email' must be a valid email address consisting of characters, an '@', and more characters. It should not be the default contact email address 'admin@software-carpentry.org'. 'email' must be a comma-separated list of valid email addresses. The list may be empty. A valid email address consists of characters, an '@', and more characters. It should not contain the default contact """ return bool(re.match(EMAIL_PATTERN, email)) and \ (email != DEFAULT_CONTACT_EMAIL) # YAML automatically loads list-like strings as lists. 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 else: return False return True def check_eventbrite(eventbrite): Loading Loading @@ -286,8 +293,9 @@ HANDLERS = { 'helper list isn\'t a valid list of format ' + '["First helper", "Second helper",..]'), 'email': (True, check_email, 'contact email invalid or still set to ' + 'email': (True, check_emails, 'contact email list isn\'t a valid list of format ' + '["me@example.org", "you@example.org",..] or contains incorrectly formatted email addresses or ' + '"{0}".'.format(DEFAULT_CONTACT_EMAIL)), 'eventbrite': (False, check_eventbrite, 'Eventbrite key appears invalid'), Loading