taskapp/events/user.py
changeset 107 4903b4973fc8
parent 31 988d4994578f
child 153 925af1b4ee65
equal deleted inserted replaced
106:3c3ea2a3f92a 107:4903b4973fc8
    44     su_user = createUser(username,email,password,dob,gender)
    44     su_user = createUser(username,email,password,dob,gender)
    45     su_user.is_staff = True
    45     su_user.is_staff = True
    46     su_user.is_superuser = True
    46     su_user.is_superuser = True
    47     su_user.save()
    47     su_user.save()
    48     return su_user
    48     return su_user
       
    49 
       
    50 def changeRole(role, user):
       
    51     """ change the status of user to role.
       
    52     """
       
    53 
       
    54     user_profile = user.get_profile()
       
    55     user_profile.rights = role
       
    56     user_profile.save()