mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-24 16:10:33 -06:00
Proper error should be thrown when server group is created with existing name. Fixes #3693
This commit is contained in:
parent
7b0c81126c
commit
2a359d9d77
@ -9,6 +9,7 @@ for it.
|
||||
|
||||
.. toctree::
|
||||
|
||||
release_notes_4_2
|
||||
release_notes_4_1
|
||||
release_notes_4_0
|
||||
release_notes_3_6
|
||||
|
@ -14,4 +14,5 @@ Features
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Bug #3693 <https://redmine.postgresql.org/issues/3693>`_ - Proper error should be thrown when server group is created with existing name.
|
||||
| `Bug #3695 <https://redmine.postgresql.org/issues/3695>`_ - Ensure long string should be wrap in alertify dialogs.
|
@ -145,6 +145,7 @@ class ServerGroupView(NodeView):
|
||||
db.session.delete(sg)
|
||||
db.session.commit()
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return make_json_response(
|
||||
status=410, success=0, errormsg=e.message
|
||||
)
|
||||
@ -178,10 +179,12 @@ class ServerGroupView(NodeView):
|
||||
servergroup.name = data[u'name']
|
||||
db.session.commit()
|
||||
except exc.IntegrityError:
|
||||
db.session.rollback()
|
||||
return bad_request(gettext(
|
||||
"The specified server group already exists."
|
||||
))
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return make_json_response(
|
||||
status=410, success=0, errormsg=e.message
|
||||
)
|
||||
@ -251,11 +254,13 @@ class ServerGroupView(NodeView):
|
||||
)
|
||||
)
|
||||
except exc.IntegrityError:
|
||||
db.session.rollback()
|
||||
return bad_request(gettext(
|
||||
"The specified server group already exists."
|
||||
))
|
||||
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return make_json_response(
|
||||
status=410,
|
||||
success=0,
|
||||
|
Loading…
Reference in New Issue
Block a user