Changeset ce5d021


Ignore:
Timestamp:
Feb 26, 2012, 2:28:25 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
41f8b1e
Parents:
fb76571
git-author:
Alex Dehnert <adehnert@…> (02/26/12 02:28:25)
git-committer:
Alex Dehnert <adehnert@…> (02/26/12 02:28:25)
Message:

Handle non-existent users on people page (Trac: #69)

Fixes a 500 when people try to modify signatories where one or more
of the involved people in the group no longer has a valid Athena account.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r0270ed7 rce5d021  
    652652                    if person in new_holders:
    653653                        if (person, role) in officers_map:
    654                             if role.require_student and not moira_accounts[person].is_student():
     654                            if person not in moira_accounts:
     655                                pass # already errored above
     656                            elif role.require_student and not moira_accounts[person].is_student():
    655657                                msgs.append('Only students can have the %s role, and %s does not appear to be a student. (If this is not the case, please contact us.) You should replace this person ASAP.' % (role, person, ))
    656658                            #changes.append(("Kept", "yellow", person, role))
     
    658660                        else:
    659661                            if person not in moira_accounts:
    660                                 msgs.append('Could not add nonexistent Athena account "%s" as %s.' % (person, role, ))
     662                                pass # already errored above
    661663                            elif role.require_student and not moira_accounts[person].is_student():
    662664                                msgs.append('Only students can have the %s role, and %s does not appear to be a student. (If this is not the case, please contact us.)' % (role, person, ))
     
    676678                        if i in new_people:
    677679                            person = new_people[i]
     680                            assert person in moira_accounts
    678681                            if role.require_student and not moira_accounts[person].is_student():
    679682                                msgs.append('Only students can have the %s role, and %s does not appear to be a student.' % (role, person, ))
Note: See TracChangeset for help on using the changeset viewer.