def create_new_user(self, username, email, password=None, photo=None): """Creates and returns a User for the given username.""" try: user = get_auth_backend().register(username=username, email=email, password=password, photo=photo) return user except UserExistsException as e: raise UserExistsError(e) except AuthException as e: raise BackendError(e)
def create_new_user(self, username, email, password=None, photo=None): """Creates and returns a User for the given username.""" try: user = get_auth_backend().register(username=username, email=email, password=password, photo=photo) signals.user_created.send_robust(sender=self.__class__, user=user) return user except UserExistsException as e: raise exceptions.UserExistsError(e) except AuthException as e: raise exceptions.BackendError(e)