From 813582f188cead2df1a9b63368149a43a735fc1c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Apr 2012 12:24:11 -0400 Subject: [PATCH] Remove myself as the hardcoded default sender. Use the first assistant instead, since they are the most likely person to be running this database. --- bin/pg.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/pg.py b/bin/pg.py index 9a32c1d..163f43d 100755 --- a/bin/pg.py +++ b/bin/pg.py @@ -88,8 +88,8 @@ if __name__ == '__main__': '-D', '--dry-run', default=False, action='store_const', const=True, help="Don't actually send emails, create files, etc.") email_parser.add_argument( - '-a', '--author', default='Trevor King', - help='Your name (email author)') + '-a', '--author', + help='Your name (email author), defaults to first assistant') email_parser.add_argument( '--cc', action='append', help='People to carbon copy') email_subparsers = email_parser.add_subparsers(title='type') @@ -177,7 +177,11 @@ if __name__ == '__main__': for attr in ['author', 'student']: if hasattr(args, attr): name = getattr(args, attr) - kwargs[attr] = course.person(name=name) + if name is None and attr == 'author': + kwargs[attr] = list( + course.find_people(group='assistants'))[0] + else: + kwargs[attr] = course.person(name=name) for attr in ['targets']: if hasattr(args, attr): people = getattr(args, attr) -- 2.26.2