mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-10 08:04:36 -06:00
Ensure preferences are properly saved the first time they're set.
This commit is contained in:
parent
b2ab35e990
commit
757500c478
@ -197,13 +197,14 @@ class _Preference(object):
|
||||
pid=self.pid
|
||||
).filter_by(uid=current_user.id).first()
|
||||
|
||||
value = u"{}".format(value)
|
||||
if pref is None:
|
||||
pref = UserPrefTable(
|
||||
uid=current_user.id, pid=self.pid, value=value
|
||||
)
|
||||
db.session.add(pref)
|
||||
else:
|
||||
pref.value = u"{}".format(value)
|
||||
pref.value = value
|
||||
db.session.commit()
|
||||
|
||||
return True, None
|
||||
|
Loading…
Reference in New Issue
Block a user