mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
add explicit handling for empty 1:many lists
This commit is contained in:
parent
fcd4854cb8
commit
ff115284d9
@ -20,5 +20,11 @@ class BaseMixins:
|
|||||||
`self.update` method which directly passing arguments to the `__init__`
|
`self.update` method which directly passing arguments to the `__init__`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def update(self, *args, **kwarg):
|
def update(self, *args, **kwargs):
|
||||||
self.__init__(*args, **kwarg)
|
self.__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# sqlalchemy doesn't like this method to remove all instances of a 1:many relationship,
|
||||||
|
# so we explicitly check for that here
|
||||||
|
for k, v in kwargs.items():
|
||||||
|
if hasattr(self, k) and v == []:
|
||||||
|
setattr(self, k, v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user