wildfish/django-gdpr-assist

Creates migration for third party models whose manager sets `use_in_migrations=True`, such as built-in User model

fish-face opened this issue · 1 comments

I gather this is a regression. Tested with latest master against django 3.1 (and also 3.2)

from django.contrib.auth.models import User

import gdpr_assist

class UserPrivacyMeta:
    fields = ['username', 'email']


gdpr_assist.register(User, UserPrivacyMeta)

then:

$ manage.py makemigrations --dry-run
Waiting for database connection...
Migrations for 'auth':
  /opt/hunter2/venv/lib/python3.8/site-packages/django/contrib/auth/migrations/0013_alter_user_managers.py
    - Change managers on user

This of course relates to #6 but this is with the built-in user model, not a custom one, so no migrations are appropriate in this situation. I don't understand though how this wasn't picked up after fixing #5 though.

Can I suggest as a first step adding a test in which a third-party model like User is registered, and it is checked that no migrations are created in that scenario.

Hi @fish-face

Apologies for the delay. This should now be resolved for the latest release (1.4.0). Cheers