mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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
|
pid=self.pid
|
||||||
).filter_by(uid=current_user.id).first()
|
).filter_by(uid=current_user.id).first()
|
||||||
|
|
||||||
|
value = u"{}".format(value)
|
||||||
if pref is None:
|
if pref is None:
|
||||||
pref = UserPrefTable(
|
pref = UserPrefTable(
|
||||||
uid=current_user.id, pid=self.pid, value=value
|
uid=current_user.id, pid=self.pid, value=value
|
||||||
)
|
)
|
||||||
db.session.add(pref)
|
db.session.add(pref)
|
||||||
else:
|
else:
|
||||||
pref.value = u"{}".format(value)
|
pref.value = value
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
return True, None
|
return True, None
|
||||||
|
Loading…
Reference in New Issue
Block a user