Skip to content

Commit

Permalink
bring back other Model def
Browse files Browse the repository at this point in the history
  • Loading branch information
akochari committed Dec 9, 2024
1 parent 001a489 commit 132c327
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.core.exceptions import FieldDoesNotExist
from django.db.models import Model, Q
from django.db.models import Q
from django.http import (
HttpResponse,
HttpResponseBadRequest,
Expand All @@ -34,6 +34,7 @@
logger = logging.getLogger(__name__)
Apps = apps.get_model(app_label=django_settings.APPS_MODEL)
AppCategories = apps.get_model(app_label=django_settings.APPCATEGORIES_MODEL)
Model = apps.get_model(app_label=django_settings.MODELS_MODEL)
User = get_user_model()


Expand Down Expand Up @@ -176,7 +177,7 @@ def change_description(request, project_slug):
)


def can_model_instance_be_deleted(field_name: str, instance: Model) -> bool:
def can_model_instance_be_deleted(field_name, instance):
"""
Check if a model instance can be deleted by ensuring no app in APP_REGISTRY
references it via the specified field.
Expand Down

0 comments on commit 132c327

Please sign in to comment.