Ticket #33917: 0001-Move-app_config-initialization-inside-if-block.patch

File 0001-Move-app_config-initialization-inside-if-block.patch, 1010 bytes (added by Ivan Dominic Baguio, 2 years ago)
  • django/db/models/base.py

    From 7959ba86bd0b3e32f8b906b8cfbfc52ef2a89e51 Mon Sep 17 00:00:00 2001
    From: Ivan Dominic Baguio <baguio.ivan@gmail.com>
    Date: Fri, 12 Aug 2022 02:07:48 +0800
    Subject: [PATCH] Move app_config initialization inside if block
    
    ---
     django/db/models/base.py | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index 1f7e5f84aa..4373b4a278 100644
    a b class ModelBase(type):  
    123123
    124124        app_label = None
    125125
    126         # Look for an application configuration to attach the model to.
    127         app_config = apps.get_containing_app_config(module)
    128 
    129126        if getattr(meta, "app_label", None) is None:
     127            # Look for an application configuration to attach the model to.
     128            app_config = apps.get_containing_app_config(module)
     129
    130130            if app_config is None:
    131131                if not abstract:
    132132                    raise RuntimeError(
Back to Top