소스 검색

lsmodules() should only return native models

Jeremy Stretch 9 년 전
부모
커밋
4047c1a4e4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/extras/management/commands/nbshell.py

+ 1 - 1
netbox/extras/management/commands/nbshell.py

@@ -46,7 +46,7 @@ class Command(BaseCommand):
             for name in dir(app_models):
                 model = getattr(app_models, name)
                 try:
-                    if issubclass(model, Model):
+                    if issubclass(model, Model) and model._meta.app_label == app:
                         namespace[name] = model
                         self.django_models[app].append(name)
                 except TypeError: