Ignore:
Timestamp:
Jun 20, 2010, 9:10:17 AM (16 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, fysm-4-1, space-access, stable, stage, test-hooks
Children:
83cd407
Parents:
4693952
git-author:
Alex Dehnert <adehnert@…> (06/20/10 09:07:02)
git-committer:
Alex Dehnert <adehnert@…> (06/20/10 09:10:17)
Message:

Add "@mit.edu" to emails without a domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/util/import_db.py

    rb398cb1 r1753602  
    1818        line_dict[key]=elem
    1919    return line_dict
     20
     21def canonicalize_email(email):
     22    if '@' in email: return email
     23    else: return email + "@mit.edu"
    2024
    2125def db_parse_date(string):
     
    5458        g.num_community     = convert_to_int(d['NUM_OF_COMMUNITY'])
    5559        g.num_other         = convert_to_int(d['NUM_OF_OTHERS'])
    56         g.group_email       = d['STUDENT_GROUP_EMAIL']
    57         g.officer_email     = d['OFFICER_EMAIL']
     60        g.group_email       = canonicalize_email(d['STUDENT_GROUP_EMAIL'])
     61        g.officer_email     = canonicalize_email(d['OFFICER_EMAIL'])
    5862        g.main_account_id   = convert_to_int(d['MAIN_ACCOUNT_ID'])
    5963        g.funding_account_id= convert_to_int(d['FUNDING_ACCOUNT_ID'])
Note: See TracChangeset for help on using the changeset viewer.