Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on migrations - CurrentUserField argument ignored #69

Open
melboone opened this issue Jun 15, 2023 · 1 comment
Open

Error on migrations - CurrentUserField argument ignored #69

melboone opened this issue Jun 15, 2023 · 1 comment

Comments

@melboone
Copy link

Getting this error on migration:

UserWarning: You passed an argument to CurrentUserField that will be ignored. Avoid args and following kwargs: default, null, to.
warnings.warn(self.warning)

@frague59
Copy link

+1

My code looks like this, I use this model as mixin for many models in my apps.

class Administrable(models.Model):
    """An administrable model."""

    created_by = CurrentUserField(
        verbose_name=_("Created by"),
        related_name="%(app_label)s_%(class)s_creator",
    )

    updated_by = CurrentUserField(
        verbose_name=_("Updated by"),
        related_name="%(app_label)s_%(class)s_updater",
        on_update=True,
    )

    class Meta:
        """Metaclass for :class:`Administrable`."""

        abstract = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants