Skip to content

Django 4.0 compatibility #1037

@ShaheedHaque

Description

@ShaheedHaque

Describe the bug
When used with Django 4.0, there are reports of a missing migration. For example:

Migrations for 'oauth2_provider':
  /usr/local/lib/python3.8/dist-packages/oauth2_provider/migrations/0005_alter_accesstoken_user_alter_application_user_and_more.py
    - Alter field user on accesstoken
    - Alter field user on application
    - Alter field user on grant
    - Alter field user on idtoken
    - Alter field user on refreshtoken

By default, of course, normal users cannot write such a file, and applying migrations without causes warnings like this:

 Your models in app(s): 'oauth2_provider' have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

I note that Django 4.0 release notes mention the possibility of some no-op migrations being needed...I am not sure if this is the root cause.

To Reproduce
Run "./manage.py makemigrations" in a project which uses this package.

Expected behavior
Any needed migration should be provided.

Version

  • I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions