# Path: feincms3/utils.py
# class ChoicesCharField(models.CharField):
#     """
#     ``models.CharField`` with choices, which makes the migration framework
#     always ignore changes to ``choices``, ever.
#     """
# 
#     def __init__(self, *args, **kwargs):
#         kwargs.setdefault("choices", [("", "")])  # Non-empty choices for get_*_display
#         super().__init__(*args, **kwargs)
# 
#     def deconstruct(self):
#         name, path, args, kwargs = super().deconstruct()
#         kwargs["choices"] = [("", "")]
#         return name, "django.db.models.CharField", args, kwargs
# 
# def validation_error(error, *, field, exclude, **kwargs):
#     """
#     Return a validation error that is associated with a particular field if it
#     isn't excluded from validation.
# 
#     See https://github.com/django/django/commit/e8c056c31 for some background.
#     """
#     return ValidationError(
#         error if field in (exclude or ()) else {field: error}, **kwargs
#     )


import warnings
from django.conf import settings
from django.core.checks import Warning
from django.db import models
from django.db.models import Q, signals
from django.utils.translation import activate, get_language, gettext_lazy as _
from tree_queries.fields import TreeNodeForeignKey
from feincms3.utils import ChoicesCharField, validation_error
        verbose_name=_("Redirect to page"),
    )

    class Meta:
        abstract = True

    def get_redirect_url(self):
        """
        Return the URL for the redirect, if a redirect is configured
        """
        if self.redirect_to_url:
            return self.redirect_to_url
        elif self.redirect_to_page:
            return self.redirect_to_page.get_absolute_url()

    def clean_fields(self, exclude=None):
        """
        Ensure that redirects are configured properly.
        """
        super().clean_fields(exclude)

        if self.redirect_to_url and self.redirect_to_page_id:
            raise validation_error(
                _("Only set one redirect value."),
                field="redirect_to_url",
                exclude=exclude,
            )

        if self.redirect_to_page_id:
            if self.redirect_to_page_id == self.pk:

# Path: feincms3/utils.py
# class ChoicesCharField(models.CharField):
#     """
#     ``models.CharField`` with choices, which makes the migration framework
#     always ignore changes to ``choices``, ever.
#     """
# 
#     def __init__(self, *args, **kwargs):
#         kwargs.setdefault("choices", [("", "")])  # Non-empty choices for get_*_display
#         super().__init__(*args, **kwargs)
# 
#     def deconstruct(self):
#         name, path, args, kwargs = super().deconstruct()
#         kwargs["choices"] = [("", "")]
#         return name, "django.db.models.CharField", args, kwargs
# 
# def validation_error(error, *, field, exclude, **kwargs):
#     """
#     Return a validation error that is associated with a particular field if it
#     isn't excluded from validation.
# 
#     See https://github.com/django/django/commit/e8c056c31 for some background.
#     """
#     return ValidationError(
#         error if field in (exclude or ()) else {field: error}, **kwargs
#     )


# Path: feincms3/mixins.py
import warnings
from django.conf import settings
from django.core.checks import Warning
from django.db import models
from django.db.models import Q, signals
from django.utils.translation import activate, get_language, gettext_lazy as _
from tree_queries.fields import TreeNodeForeignKey
from feincms3.utils import ChoicesCharField, validation_error

        verbose_name=_("Redirect to page"),
    )

    class Meta:
        abstract = True

    def get_redirect_url(self):
        """
        Return the URL for the redirect, if a redirect is configured
        """
        if self.redirect_to_url:
            return self.redirect_to_url
        elif self.redirect_to_page:
            return self.redirect_to_page.get_absolute_url()

    def clean_fields(self, exclude=None):
        """
        Ensure that redirects are configured properly.
        """
        super().clean_fields(exclude)

        if self.redirect_to_url and self.redirect_to_page_id:
            raise validation_error(
                _("Only set one redirect value."),
                field="redirect_to_url",
                exclude=exclude,
            )

        if self.redirect_to_page_id:
            if self.redirect_to_page_id == self.pk:

                raise validation_error(