File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -239,12 +239,14 @@ def get_tdamm_tag(self, obj):
239
239
return tags if tags is not None else []
240
240
241
241
def get_document_type (self , obj ):
242
- if obj .document_type and obj .document_type != 0 :
242
+ if obj .document_type and obj .document_type not in DocumentTypes .values :
243
+ raise ValueError (f"Invalid document type: { obj .document_type } " )
244
+ elif obj .document_type is not None :
243
245
return obj .get_document_type_display ()
244
246
elif obj .collection .document_type is not None :
245
247
return obj .collection .get_document_type_display ()
246
248
else :
247
- return "Unknown"
249
+ raise ValueError ( "No document type found" )
248
250
249
251
def get_title (self , obj ):
250
252
return obj .generated_title if obj .generated_title else obj .scraped_title
You can’t perform that action at this time.
0 commit comments