Commit 33722667 authored by Raniere Silva's avatar Raniere Silva Committed by GitHub
Browse files

Merge pull request #362 from anenadic/gh-pages

Make 'contact' variable a list of strings instead of a single string. This time with tests and documentation.
parents 51e4073a 74764a52
......@@ -203,15 +203,23 @@ def check_helpers(helpers):
def check_email(email):
def check_emails(emails):
'contact' must be a valid email address consisting of characters,
an '@', and more characters. It should not be the default contact
'contact' 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
email address ''.
return bool(re.match(EMAIL_PATTERN, email)) and \
# 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
return False
return True
def check_eventbrite(eventbrite):
......@@ -286,8 +294,9 @@ HANDLERS = {
'helper list isn\'t a valid list of format ' +
'["First helper", "Second helper",..]'),
'contact': (True, check_email,
'contact email invalid or still set to ' +
'contact': (True, check_emails,
'contact email list isn\'t a valid list of format ' +
'["", "",..] or contains incorrectly formatted email addresses or ' +
'eventbrite': (False, check_eventbrite, 'Eventbrite key appears invalid'),
......@@ -13,7 +13,7 @@ startdate: FIXME # machine-readable start date for the workshop in YYYY-MM-
enddate: FIXME # machine-readable end date for the workshop in YYYY-MM-DD format like 2015-01-02
instructor: ["FIXME"] # boxed, comma-separated list of instructors' names as strings, like ["Kay McNulty", "Betty Jennings", "Betty Snyder"]
helper: ["FIXME"] # boxed, comma-separated list of helpers' names, like ["Marlyn Wescoff", "Fran Bilas", "Ruth Lichterman"]
contact: "FIXME" # contact email address for host, lead instructor, or whoever else is handling questions
contact: [""] # boxed, comma-separated list of contact email addresses for the host, lead instructor, or whoever else is handling questions, like ["", "", ""]
etherpad: # optional: URL for the workshop Etherpad if there is one
eventbrite: # optional: alphanumeric key for Eventbrite registration, e.g., "1234567890AB" (if Eventbrite is being used)
......@@ -155,9 +155,22 @@ and the administrator will contact you if we need any extra information.</h4>
<p id="contact">
Please mail
<a href="mailto:{{}}">{{}}</a> for more
Please email
{% if %}
{% for contact in %}
{% if forloop.last and > 1 %}
{% else %}
{% unless forloop.first %}
{% endunless %}
{% endif %}
<a href='mailto:{{contact}}'>{{contact}}</a>
{% endfor %}
{% else %}
{% endif %}
for more information.
Markdown is supported
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