Fixed an issue where shared server entries not getting deleted from SQLite database if the user gets deleted. Fixes #6143

This commit is contained in:
Nikhil Mohite 2021-01-21 14:23:02 +05:30 committed by Akshay Joshi
parent 3e09f1bf40
commit 57ed02a9aa
2 changed files with 4 additions and 1 deletions

View File

@ -52,4 +52,5 @@ Bug fixes
| `Issue #6122 <https://redmine.postgresql.org/issues/6122>`_ - Added informative message when there is no difference found for schema diff.
| `Issue #6128 <https://redmine.postgresql.org/issues/6128>`_ - Fixed an issue where sequences are not created.
| `Issue #6140 <https://redmine.postgresql.org/issues/6140>`_ - Ensure that verbose logs should be visible for Utility(Backup, Maintenance) jobs.
| `Issue #6143 <https://redmine.postgresql.org/issues/6143>`_ - Fixed an issue where shared server entries not getting deleted from SQLite database if the user gets deleted.
| `Issue #6144 <https://redmine.postgresql.org/issues/6144>`_ - Ensure that the current value of the sequence should be ignored while comparing using schema diff.

View File

@ -28,7 +28,7 @@ from pgadmin.utils.constants import MIMETYPE_APP_JS, INTERNAL,\
SUPPORTED_AUTH_SOURCES, KERBEROS
from pgadmin.utils.validation_utils import validate_email
from pgadmin.model import db, Role, User, UserPreference, Server, \
ServerGroup, Process, Setting
ServerGroup, Process, Setting, SharedServer
# set template path for sql scripts
MODULE_NAME = 'user_management'
@ -347,6 +347,8 @@ def delete(uid):
Process.query.filter_by(user_id=uid).delete()
SharedServer.query.filter_by(user_id=uid).delete()
# Finally delete user
db.session.delete(usr)