Fix exception when removing a group name in Sqlite db when group
name is already missing. Fixes #12367
This commit is contained in:
parent
8ceccb4a28
commit
fec961d992
@ -577,12 +577,13 @@ class DBAPI(DbGeneric):
|
|||||||
"WHERE name = ?", [grouping, name])
|
"WHERE name = ?", [grouping, name])
|
||||||
elif row and grouping is None:
|
elif row and grouping is None:
|
||||||
self.dbapi.execute("DELETE FROM name_group WHERE name = ?", [name])
|
self.dbapi.execute("DELETE FROM name_group WHERE name = ?", [name])
|
||||||
grouping = ''
|
|
||||||
else:
|
else:
|
||||||
self.dbapi.execute(
|
self.dbapi.execute(
|
||||||
"INSERT INTO name_group (name, grouping) VALUES (?, ?)",
|
"INSERT INTO name_group (name, grouping) VALUES (?, ?)",
|
||||||
[name, grouping])
|
[name, grouping])
|
||||||
self._txn_commit()
|
self._txn_commit()
|
||||||
|
if grouping is None:
|
||||||
|
grouping = ''
|
||||||
self.emit('person-groupname-rebuild', (name, grouping))
|
self.emit('person-groupname-rebuild', (name, grouping))
|
||||||
|
|
||||||
def _commit_base(self, obj, obj_key, trans, change_time):
|
def _commit_base(self, obj, obj_key, trans, change_time):
|
||||||
|
Loading…
Reference in New Issue
Block a user