Skip to content

Commit

Permalink
#356 Fix Django deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroLQueiroz committed May 3, 2024
1 parent db5d921 commit 836a4c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
from django.db.models import Index
from django.utils import version

_version = version.get_version_tuple(version.get_version())
if _version[0] >= 4 and _version[1] >= 2:
major, minor, *_ = version.get_version_tuple(version.get_version())
version = major * 10 + minor
if version >= 42:
_operations = [
migrations.AddIndex(
model_name="notification",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
# Generated by Django 4.2.11 on 2024-05-03 00:08

from django.db import migrations
from django.db.models import Index
from django.utils import version


class Migration(migrations.Migration):
dependencies = [
("notifications", "0015_alter_notification_action_object_content_type_and_more"),
]

operations = [
major, minor, *_ = version.get_version_tuple(version.get_version())
version = major * 10 + minor
if version >= 42:
_operations = [
migrations.RenameIndex(
model_name="notification",
new_name="notificatio_recipie_8bedf2_idx",
old_fields=("recipient", "unread"),
),
]
else:
_operations = []


class Migration(migrations.Migration):
dependencies = [
("notifications", "0015_alter_notification_action_object_content_type_and_more"),
]

operations = _operations

0 comments on commit 836a4c0

Please sign in to comment.