Skip to content

Commit

Permalink
Remove try-except around python type extraction in get_schema_field
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertKolner committed Nov 5, 2024
1 parent 1f08938 commit 046aac3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ninja/orm/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ def get_schema_field(
python_type = field.get_schema_type()
else:
internal_type = field.get_internal_type()

try:
python_type = TYPES[internal_type]
except KeyError as e:
raise KeyError("Type '{0}' isn't registered in ninja.orm.fields.TYPES".format(internal_type)) from e
python_type = TYPES[internal_type]

if field.primary_key or blank or null or optional:
default = None
Expand Down

0 comments on commit 046aac3

Please sign in to comment.