File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22from django .views .decorators .http import require_http_methods
33
44# Apel loader and record-checking class imports
5- from apel .db .loader .loader import Loader
5+ from apel .db import ApelDbException
6+ from apel .db .loader .loader import Loader , LoaderException
67from apel .db .loader .record_factory import RecordFactory , RecordFactoryException
78from apel .db .records .record import InvalidRecordException
89
@@ -103,7 +104,7 @@ def validate(record: str, record_type: str) -> str:
103104 record_class = record_map [record_type ]
104105 result = recordFactory ._create_record_objects (record , record_class )
105106
106- if "Record object at" in str (result ):
107+ if "object at" in str (result ):
107108 return "Record(s) valid!"
108109
109110 return str (result )
@@ -148,5 +149,5 @@ def load(record: str) -> str:
148149
149150 return ("Record(s) will load successfully!" )
150151
151- except Exception as e :
152+ except ( ApelDbException , InvalidRecordException , LoaderException , RecordFactoryException ) as e :
152153 return str (e )
You can’t perform that action at this time.
0 commit comments