Don't let CUSTOMER4 users change their names through the JSON API.

(imported from commit ea1f26866e727eff995f78f1f0aeb6bb82b1b997)
This commit is contained in:
Jessica McKellar 2013-08-04 20:21:47 -04:00
parent 118a2075d9
commit c95a762e2f
1 changed files with 7 additions and 0 deletions

View File

@ -744,6 +744,13 @@ def do_change_password(user_profile, password, log=True, commit=True,
'pwhash': user_profile.password})
def do_change_full_name(user_profile, full_name, log=True):
if user_profile.realm.domain == "users.customer4.invalid":
# At the request of the facilitators, CUSTOMER4 users
# can't change their names. Failingly silently is fine -- they
# can't do it through the UI, so they'd have to be trying to
# break the rules.
return
user_profile.full_name = full_name
user_profile.save(update_fields=["full_name"])
if log: