@@ -445,8 +445,6 @@ def get_model(
445445 Generates a temporary Django model based on available fields that belong to
446446 this table. Returns cached model if available, otherwise generates and caches it.
447447
448- :param fields: Extra table field instances that need to be added the model.
449- :type fields: list
450448 :param skip_object_fields: Don't add object or multiobject fields to the model
451449 :type skip_object_fields: bool
452450 :return: The generated model.
@@ -527,16 +525,6 @@ def wrapped_post_through_setup(self, cls):
527525 del apps .all_models [APP_LABEL ][model_name .lower ()]
528526
529527 apps .register_model (APP_LABEL , model )
530- '''
531- try:
532- existing_model = apps.get_model(APP_LABEL, model_name)
533- # If model exists but is different, we have a problem
534- if existing_model is not model:
535- # Use the existing model to avoid conflicts
536- model = existing_model
537- except LookupError:
538- apps.register_model(APP_LABEL, model)
539- '''
540528
541529 self ._after_model_generation (attrs , model )
542530
@@ -548,13 +536,6 @@ def wrapped_post_through_setup(self, cls):
548536 apps .clear_cache ()
549537 ContentType .objects .clear_cache ()
550538
551- '''
552- # Register the serializer for this model
553- from netbox_custom_objects.api.serializers import get_serializer_class
554-
555- get_serializer_class(model)
556- '''
557-
558539 # Register the global SearchIndex for this model
559540 self .register_custom_object_search_index (model )
560541
0 commit comments