Changes between Initial Version and Version 1 of Ticket #33366


Ignore:
Timestamp:
Dec 14, 2021, 11:13:37 AM (3 years ago)
Author:
Andrew Chen Wang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33366 – Description

    initial v1  
    22
    33Our model for reproduction:
    4 ```
     4
     5{{{
    56class RefreshToken(models.Model):
    67    user = models.ForeignKey(
    78        settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="%(app_label)s_%(class)s"
    89    )
    9 ```
     10
     11}}}
     12
    1013
    1114Users of the package are running `makemigrations` and having to see something like this (ref: https://github.com/jazzband/django-oauth-toolkit/issues/1037):
    1215
    13 ```
     16{{{
    1417migrations.AlterField(
    1518            model_name='refreshtoken',
     
    1720            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s', to='auth.user'),
    1821        ),
    19 ```
     22}}}
    2023
    2124Specifically, `to='auth.user'` is the issue. Our previous migrations properly had `to=settings.AUTH_USER_MODEL`. Please let me know how to fix this or whether this is a bug. Thanks!
Back to Top