Skip to content

[bug] Django 5.0+ Compatibility: Replace index_together with indexes #433

Open
@Eeshu-Yadav

Description

@Eeshu-Yadav

Describe the bug
Running migrations with Django 5.0+ results in the error:
TypeError: 'class Meta' got invalid attribute(s): index_together.
This occurs because index_together was deprecated in Django 4.2 and removed in Django 5.0 .

Steps To Reproduce
Steps to reproduce the behavior:
Replace the deprecated index_together with the modern indexes syntax in the Meta class of AbstractUser:

indexes = [
    models.Index(fields=['id', 'email']),
]

Expected behavior
A clear and concise description of what you expected to happen.

Affected Files

  • openwisp_users/base/models.py

Screenshots
Before : Image

System Informatioon:

  • OS: [Ubuntu 20.04 LTS]
  • Python Version: [Python 3.11]
  • Django Version: [Django 5.1.0]

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