Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix content type field name on Saleor Permission

fowczrek05cf5ad42d2b
diff --git a/saleor/account/migrations/0072_group.py b/saleor/account/migrations/0072_group.py
index 339be2a251..7f7b958f9b 100644
--- a/saleor/account/migrations/0072_group.py
+++ b/saleor/account/migrations/0072_group.py
@@ -105,6 +105,7 @@ class Migration(migrations.Migration):
dependencies = [
("account", "0071_user_external_reference"),
("app", "0017_app_audience"),
+ ("auth", "0012_alter_user_first_name_max_length"),
]
operations = [
diff --git a/saleor/core/permissions/enums.py b/saleor/core/permissions/enums.py
index c3e499102c..39bae7ca38 100644
--- a/saleor/core/permissions/enums.py
+++ b/saleor/core/permissions/enums.py
@@ -3,7 +3,6 @@ from typing import Iterable, List
from django.db.models import QuerySet
-# TODO Owczar: consider move this file to saleor.permissions
from ...permission.models import Permission
diff --git a/saleor/permission/migrations/0002_alter_permission_content_type.py b/saleor/permission/migrations/0002_alter_permission_content_type.py
new file mode 100644
index 0000000000..7913213979
--- /dev/null
+++ b/saleor/permission/migrations/0002_alter_permission_content_type.py
@@ -0,0 +1,26 @@
+# Generated by Django 3.2.16 on 2022-12-21 12:44
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("contenttypes", "0002_remove_content_type_name"),
+ ("permission", "0001_initial"),
+ ("auth", "0013_auto_20221214_1224"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="permission",
+ name="content_type",
+ field=models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="content_type",
+ to="contenttypes.contenttype",
+ verbose_name="content type",
+ ),
+ ),
+ ]
diff --git a/saleor/permission/models.py b/saleor/permission/models.py
index 3af8b015e9..a677838267 100644
--- a/saleor/permission/models.py
+++ b/saleor/permission/models.py
@@ -79,8 +79,7 @@ class Permission(models.Model):
ContentType,
models.CASCADE,
verbose_name=_("content type"),
- # TODO Owczar: Remove related_name after drop django auth.
- related_name="saleor_content_type",
+ related_name="content_type",
)
codename = models.CharField(_("codename"), max_length=100)