[Fix] Export error on DB access
Export operations were using an old Client select methods signature to pass in the opened session. Session is no longer needed to a simple select.
This commit is contained in:
parent
a355ec3642
commit
a527fa5e1d
@ -245,10 +245,7 @@ class Manager:
|
|||||||
session.insert(transactions)
|
session.insert(transactions)
|
||||||
|
|
||||||
case Operation.Export:
|
case Operation.Export:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(Transaction))
|
||||||
self.dump(
|
|
||||||
params[0], params[1], self.database.select(Transaction, session)
|
|
||||||
)
|
|
||||||
|
|
||||||
case Operation.Import:
|
case Operation.Import:
|
||||||
transactions = []
|
transactions = []
|
||||||
@ -284,8 +281,7 @@ class Manager:
|
|||||||
self.database.insert(transactions)
|
self.database.insert(transactions)
|
||||||
|
|
||||||
case Operation.ExportBanks:
|
case Operation.ExportBanks:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(Bank))
|
||||||
self.dump(params[0], params[1], self.database.select(Bank, session))
|
|
||||||
|
|
||||||
case Operation.ImportBanks:
|
case Operation.ImportBanks:
|
||||||
banks = []
|
banks = []
|
||||||
@ -299,12 +295,7 @@ class Manager:
|
|||||||
self.database.insert(banks)
|
self.database.insert(banks)
|
||||||
|
|
||||||
case Operation.ExportCategoryRules:
|
case Operation.ExportCategoryRules:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(CategoryRule))
|
||||||
self.dump(
|
|
||||||
params[0],
|
|
||||||
params[1],
|
|
||||||
self.database.select(CategoryRule, session),
|
|
||||||
)
|
|
||||||
|
|
||||||
case Operation.ImportCategoryRules:
|
case Operation.ImportCategoryRules:
|
||||||
rules = [CategoryRule(**row) for row in self.load(params[0], params[1])]
|
rules = [CategoryRule(**row) for row in self.load(params[0], params[1])]
|
||||||
@ -313,10 +304,7 @@ class Manager:
|
|||||||
self.database.insert(rules)
|
self.database.insert(rules)
|
||||||
|
|
||||||
case Operation.ExportTagRules:
|
case Operation.ExportTagRules:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(TagRule))
|
||||||
self.dump(
|
|
||||||
params[0], params[1], self.database.select(TagRule, session)
|
|
||||||
)
|
|
||||||
|
|
||||||
case Operation.ImportTagRules:
|
case Operation.ImportTagRules:
|
||||||
rules = [TagRule(**row) for row in self.load(params[0], params[1])]
|
rules = [TagRule(**row) for row in self.load(params[0], params[1])]
|
||||||
@ -325,10 +313,7 @@ class Manager:
|
|||||||
self.database.insert(rules)
|
self.database.insert(rules)
|
||||||
|
|
||||||
case Operation.ExportCategories:
|
case Operation.ExportCategories:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(Category))
|
||||||
self.dump(
|
|
||||||
params[0], params[1], self.database.select(Category, session)
|
|
||||||
)
|
|
||||||
|
|
||||||
case Operation.ImportCategories:
|
case Operation.ImportCategories:
|
||||||
# rules = [Category(**row) for row in self.load(params[0])]
|
# rules = [Category(**row) for row in self.load(params[0])]
|
||||||
@ -350,12 +335,7 @@ class Manager:
|
|||||||
self.database.insert(categories)
|
self.database.insert(categories)
|
||||||
|
|
||||||
case Operation.ExportCategoryGroups:
|
case Operation.ExportCategoryGroups:
|
||||||
with self.database.session as session:
|
self.dump(params[0], params[1], self.database.select(CategoryGroup))
|
||||||
self.dump(
|
|
||||||
params[0],
|
|
||||||
params[1],
|
|
||||||
self.database.select(CategoryGroup, session),
|
|
||||||
)
|
|
||||||
|
|
||||||
case Operation.ImportCategoryGroups:
|
case Operation.ImportCategoryGroups:
|
||||||
groups = [
|
groups = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user