[Django] #34087: Migration ignores Inheritance for Meta.default_permissions

7 views
Skip to first unread message

Django

unread,
Oct 12, 2022, 8:44:00 AM10/12/22
to django-...@googlegroups.com
#34087: Migration ignores Inheritance for Meta.default_permissions
--------------------------------------+------------------------
Reporter: Ron | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
Hi there!

I just encountered a bug I believe. I created a [demo
repo](https://github.com/GitRon/django-migrations-bug-default-permissions-
demo) to help isolate the problem.

I created two models here: https://github.com/GitRon/django-migrations-
bug-default-permissions-demo/blob/main/migration_bug_demo/demo/models.py

Model one inherits from a Mixin which defines "Meta.default_permissions".
The other one defines the Meta itself.

As you can see in the migration, the inheritance is being ignored:

Model with direct definition of "default_permissions":
https://github.com/GitRon/django-migrations-bug-default-permissions-
demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L29

Model with inherited definition of "default_permissions":
https://github.com/GitRon/django-migrations-bug-default-permissions-
demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L46

I hope you agree with my opinion!

Best regards
Ronny

--
Ticket URL: <https://code.djangoproject.com/ticket/34087>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 12, 2022, 9:03:33 AM10/12/22
to django-...@googlegroups.com
#34087: Migration ignores Inheritance for Meta.default_permissions
----------------------------+--------------------------------------

Reporter: Ron | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Description changed by Ron:

Old description:

> Hi there!
>
> I just encountered a bug I believe. I created a [demo
> repo](https://github.com/GitRon/django-migrations-bug-default-

> permissions-demo) to help isolate the problem.


>
> I created two models here: https://github.com/GitRon/django-migrations-
> bug-default-permissions-demo/blob/main/migration_bug_demo/demo/models.py
>
> Model one inherits from a Mixin which defines "Meta.default_permissions".
> The other one defines the Meta itself.
>
> As you can see in the migration, the inheritance is being ignored:
>
> Model with direct definition of "default_permissions":
> https://github.com/GitRon/django-migrations-bug-default-permissions-
> demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L29
>
> Model with inherited definition of "default_permissions":
> https://github.com/GitRon/django-migrations-bug-default-permissions-
> demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L46
>
> I hope you agree with my opinion!
>
> Best regards
> Ronny

New description:

Hi there!

I just encountered a bug I believe. I created a [demo
repo](https://github.com/GitRon/django-migrations-bug-default-permissions-
demo) to help isolate the problem.

I created two models here: https://github.com/GitRon/django-migrations-
bug-default-permissions-demo/blob/main/migration_bug_demo/demo/models.py

Model one inherits from a Mixin which defines "Meta.default_permissions".
The other one defines the Meta itself.

As you can see in the migration, the inheritance is being ignored:

Model with direct definition of "default_permissions":
https://github.com/GitRon/django-migrations-bug-default-permissions-
demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L29

Model with inherited definition of "default_permissions":
https://github.com/GitRon/django-migrations-bug-default-permissions-
demo/blob/main/migration_bug_demo/demo/migrations/0001_initial.py#L46

I hope you agree with my opinion! Other options like "managed" will be
inherited, so I really do think this is a bug and not a feature.

Best regards
Ronny

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34087#comment:1>

Django

unread,
Oct 12, 2022, 12:36:55 PM10/12/22
to django-...@googlegroups.com
#34087: Migration ignores Inheritance for Meta.default_permissions
----------------------------+--------------------------------------
Reporter: Ron | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


Comment:

As far as I'm aware, it's a duplicate of #29386.

--
Ticket URL: <https://code.djangoproject.com/ticket/34087#comment:2>

Django

unread,
Oct 13, 2022, 3:16:28 AM10/13/22
to django-...@googlegroups.com
#34087: Migration ignores Inheritance for Meta.default_permissions
----------------------------+--------------------------------------
Reporter: Ron | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------

Comment (by Ron):

Hi Mariusz! Sorry, I used the search but I didnt find the other ticket!

--
Ticket URL: <https://code.djangoproject.com/ticket/34087#comment:3>

Reply all
Reply to author
Forward
0 new messages