mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
fix: rename error to message
This commit is contained in:
parent
d427329e36
commit
3d3e5bc222
|
@ -43,13 +43,13 @@ FAILED_TO_SETUP_PASSWORD_TEXT = "Failed to set a password for a user. The proble
|
||||||
|
|
||||||
|
|
||||||
def return_failed_mutation_return(
|
def return_failed_mutation_return(
|
||||||
error: str,
|
message: str,
|
||||||
code: int = 400,
|
code: int = 400,
|
||||||
username: str = None,
|
username: str = None,
|
||||||
) -> UserMutationReturn:
|
) -> UserMutationReturn:
|
||||||
return UserMutationReturn(
|
return UserMutationReturn(
|
||||||
success=False,
|
success=False,
|
||||||
message=str(error),
|
message=str(message),
|
||||||
code=code,
|
code=code,
|
||||||
user=get_user_by_username(username) if username else None,
|
user=get_user_by_username(username) if username else None,
|
||||||
)
|
)
|
||||||
|
@ -97,7 +97,6 @@ class UsersMutations:
|
||||||
InvalidConfiguration,
|
InvalidConfiguration,
|
||||||
) as error:
|
) as error:
|
||||||
return return_failed_mutation_return(
|
return return_failed_mutation_return(
|
||||||
error=error,
|
|
||||||
message=error.get_description(),
|
message=error.get_description(),
|
||||||
)
|
)
|
||||||
except UsernameForbidden as error:
|
except UsernameForbidden as error:
|
||||||
|
|
Loading…
Reference in a new issue