Fixed mutation #378
This commit is contained in:
@@ -46,4 +46,5 @@ input ShortRoleNameInput {
|
||||
roleId: String
|
||||
roleName: String
|
||||
position: String
|
||||
serverId: ID
|
||||
}
|
@@ -36,10 +36,15 @@ class ShortRoleNameMutation(QueryABC):
|
||||
|
||||
short_role_name = ShortRoleName(
|
||||
input["shortName"],
|
||||
input["roleId"],
|
||||
int(input["roleId"]),
|
||||
input["position"],
|
||||
server,
|
||||
)
|
||||
|
||||
result = self._short_role_names.find_short_role_name_by_role_id(short_role_name.role_id)
|
||||
if result is not None:
|
||||
raise ValueError("Short name for role already exists")
|
||||
|
||||
self._short_role_names.add_short_role_name(short_role_name)
|
||||
self._db.save_changes()
|
||||
|
||||
@@ -47,7 +52,7 @@ class ShortRoleNameMutation(QueryABC):
|
||||
return (
|
||||
srn.short_name == short_role_name.short_name
|
||||
and srn.role_id == short_role_name.role_id
|
||||
and srn.position == short_role_name.position
|
||||
and srn.position.value == short_role_name.position
|
||||
)
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user