diff --git a/src/openforms/translations/api/serializers.py b/src/openforms/translations/api/serializers.py index 31749cc54f..43f5812df9 100644 --- a/src/openforms/translations/api/serializers.py +++ b/src/openforms/translations/api/serializers.py @@ -1,7 +1,6 @@ from typing import cast from django.conf import settings -from django.db.models.base import ModelBase from django.utils.translation import gettext_lazy as _ from modeltranslation.manager import get_translatable_fields_for_model @@ -93,7 +92,7 @@ def _get_field(self, language_code: str): parent = cast(serializers.ModelSerializer, parent) base = type(parent) - model: ModelBase = parent.Meta.model + model = parent.Meta.model # get the translatable models fields, with deterministic ordering _translatable_fields = get_translatable_fields_for_model(model) or [] translatable_fields = [ diff --git a/src/openforms/utils/files.py b/src/openforms/utils/files.py index 5ad266ca4b..c636627d15 100644 --- a/src/openforms/utils/files.py +++ b/src/openforms/utils/files.py @@ -7,13 +7,13 @@ import logging from django.db import models, transaction -from django.db.models.base import ModelBase +from django.db.models import Model from django.db.models.fields.files import FieldFile logger = logging.getLogger(__name__) -def get_file_field_names(model: ModelBase) -> list[str]: +def get_file_field_names(model: type[Model]) -> list[str]: """ Collect names of :class:`django.db.models.FileField` (& subclass) model fields. """