Exemplo n.º 1
0
 def restore_object(self, attrs, instance=None):
     if instance is not None:
         for k, v in attrs.iteritems():
             setattr(instance, k, v)
         return instance
     confirm_pw = attrs.get('confirm_password')
     del attrs['confirm_password']
     customUser = CustomUser(**attrs)
     customUser.confirm_password = confirm_pw
     #customUser.company = customUser.company.company_id # hack to return only the company ID instead of entire object
     return CustomUser(**attrs)