File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -78,21 +78,12 @@ def ready(self):
7878 super ().ready ()
7979
8080 def get_model (self , model_name , require_ready = True ):
81- if "table" in model_name .lower () and "model" in model_name .lower ():
82- is_custom_object_model = True
83- else :
84- is_custom_object_model = False
85-
8681 self .apps .check_apps_ready ()
87- if not is_custom_object_model :
88- try :
89- # if the model is already loaded, return it
90- return super ().get_model (model_name , require_ready )
91- except LookupError :
92- try :
93- self .apps .check_apps_ready ()
94- except AppRegistryNotReady :
95- raise
82+ try :
83+ # if the model is already loaded, return it
84+ return super ().get_model (model_name , require_ready )
85+ except LookupError :
86+ pass
9687
9788 model_name = model_name .lower ()
9889 # only do database calls if we are sure the app is ready to avoid
Original file line number Diff line number Diff line change @@ -524,7 +524,6 @@ def get_model(
524524 # Add this model to the set of models being generated
525525 _generating_models .add (self .id )
526526
527- app_models = apps .all_models [APP_LABEL ]
528527 model_name = self .get_table_model_name (self .pk )
529528
530529 # TODO: Add other fields with "index" specified
You can’t perform that action at this time.
0 commit comments