mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-30 05:21:08 +00:00
better checking for empty values
This commit is contained in:
parent
91908eb1b6
commit
e2f921b7f5
1 changed files with 2 additions and 0 deletions
|
@ -68,6 +68,8 @@ class ActivityObject:
|
||||||
for field in fields(self):
|
for field in fields(self):
|
||||||
try:
|
try:
|
||||||
value = kwargs[field.name]
|
value = kwargs[field.name]
|
||||||
|
if value in (None, MISSING):
|
||||||
|
raise KeyError()
|
||||||
try:
|
try:
|
||||||
is_subclass = issubclass(field.type, ActivityObject)
|
is_subclass = issubclass(field.type, ActivityObject)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|
Loading…
Reference in a new issue