code: def custom_update_user(sender, instance, attributes, user_modified, **kargs):
      
      for k, v in attributes.items():
          u = set.intersection(set(v), set([u'true', u'false']))
          if u:
              setattr(instance, k, u.pop() == u'true')
      return True
docs: Default behaviour does not play nice with booleans encoded in SAML as u'true'/u'false'.
          This will convert those attributes to real booleans when saving.