code: def get_user_id(self, attributes):
          
          if not attributes:
              raise ImproperlyConfigured("CAS_CREATE_USER_WITH_ID is True, but "
                                         "no attributes were provided")
  
          user_id = attributes.get('id')
  
          if not user_id:
              raise ImproperlyConfigured("CAS_CREATE_USER_WITH_ID is True, but "
                                         "`'id'` is not part of attributes.")
  
          return user_id
docs: For use when CAS_CREATE_USER_WITH_ID is True. Will raise ImproperlyConfigured
          exceptions when a user_id cannot be accessed. This is important because we
          shouldn't create Users with automatically assigned ids if we are trying to
          keep User primary key's in sync.