Skip to content

Commit f9d7347

Browse files
committed
#245 only bypass exception for get_model if in test / migration
1 parent c91a446 commit f9d7347

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

netbox_custom_objects/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def ready(self):
9898
get_serializer_class(model)
9999
except (DatabaseError, OperationalError, ProgrammingError) as e:
100100
# Only suppress exceptions during tests when schema may not match model
101-
# (is_running_migration is already handled by early return above)
102101
# During normal operation, re-raise to alert of actual problems
103102
if is_running_test():
104103
# The transaction.atomic() block will automatically rollback
@@ -176,7 +175,6 @@ def get_models(self, include_auto_created=False, include_swapped=False):
176175
except (DatabaseError, OperationalError, ProgrammingError) as e:
177176
# Only suppress exceptions during tests when schema may not match model
178177
# (e.g., cache_timestamp column doesn't exist yet during test setup)
179-
# (is_running_migration is already handled by early return above)
180178
# During normal operation, re-raise to alert of actual problems
181179
if is_running_test():
182180
# The transaction.atomic() block will automatically rollback

0 commit comments

Comments
 (0)