[Role] Fix Rolerename
Wenn gleicher name mitgesendet wird, wird die umbenennung nicht durchgeführt.
This commit is contained in:
parent
c7642758ed
commit
04753e9a41
|
@ -26,6 +26,8 @@ def get_permissions():
|
||||||
|
|
||||||
|
|
||||||
def rename(role, new_name):
|
def rename(role, new_name):
|
||||||
|
if role.name == new_name:
|
||||||
|
return
|
||||||
if db.session.query(db.exists().where(Role.name == new_name)).scalar():
|
if db.session.query(db.exists().where(Role.name == new_name)).scalar():
|
||||||
raise BadRequest("Name already used")
|
raise BadRequest("Name already used")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue