extract singular tags, languages, locations from kwargs

This commit is contained in:
Lex Berezhny 2020-05-18 08:15:24 -04:00
parent d232eeaf81
commit e3f080a7ad
2 changed files with 4 additions and 2 deletions

View file

@ -1 +0,0 @@
from .claim import Claim

View file

@ -139,7 +139,10 @@ class BaseClaim:
field = getattr(self, l) field = getattr(self, l)
if kwargs.pop(f'clear_{l}', False): if kwargs.pop(f'clear_{l}', False):
del field[:] del field[:]
items = kwargs.pop(l, None) if l in ('tags', 'languages', 'locations'):
items = kwargs.pop(l[:-1], None)
else:
items = kwargs.pop(l, None)
if items is not None: if items is not None:
if isinstance(items, str): if isinstance(items, str):
field.append(items) field.append(items)