Re: [Django] #30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-15 Thread Django
#30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to 
apply
-+
 Reporter:  Julien Enselme   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.auth |  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by felixxm):

 * cc: Simon Charette, Arthur Rio, Antoine Catton (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Reproduced with steps from
 [https://code.djangoproject.com/ticket/30351#comment:3 comment]. It's
 probably regression in 181fb60159e54d442d3610f4afba6f066a6dac05.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.bd58b6bde44157036f8393eec3a65924%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-15 Thread Django
#30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to 
apply
+--
 Reporter:  Julien Enselme  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  2.2
 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
+--

Comment (by Sébastiaan Versteeg):

 To get into the situation where you already have permissions with the
 content type you should be able to do the following:
 - Start on Django <2.2
 - Create a model called 'TestModel'
 - Migrate
 - Delete the model called 'TestModel'
 - Add a new **proxy** model called 'TestModel'
 - Migrate
 - Update to Django >=2.2
 - Migrate

 We think this is what happened in our case where we found this issue
 (https://sentry.thalia.nu/share/issue/68be0f8c32764dec97855b3cbb3d8b55/).
 We have a proxy model with the same name that a previous non-proxy model
 once had. This changed during a refactor and the permissions for the
 original model still exist.
 Our solution will probably be removing the existing permissions from the
 table, but that's really only a workaround.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.c3e480b3a1030d7f10c234d375a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-14 Thread Django
#30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to 
apply
+--
 Reporter:  Julien Enselme  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  2.2
 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
+--

Comment (by kiahosseini):

 Same problem for me.
 If a `Permission` exists already with the new `content_type` and
 `permission name`, `IntegrityError` is raised as it violates the
 unique_key constraint on permission model or `content_type_id_code_name`

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.bd262e1cd0afd07465fef98623e34103%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-11 Thread Django
#30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to 
apply
--+--
 Reporter:  Jenselme  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  2.2
 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
--+--
Changes (by Tim Graham):

 * component:  Uncategorized => contrib.auth
 * type:  Uncategorized => Bug


Comment:

 Please provide a sample project or enough details to reproduce the issue.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5a77a18ca52c63738e33c2dae1051512%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-11 Thread Django
#30351: Migration auth.0011_update_proxy_permissions from Django 2.2 fails to 
apply
-+
   Reporter:  Jenselme   |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  2.2
   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  |
-+
 I am trying to update my project to Django 2.2. When I launch `python
 manage.py migrate`, I get this error message when migration
 `auth.0011_update_proxy_permissions` is applying (full stacktrace is
 available [https://dpaste.de/5nJJ here]):
 `django.db.utils.IntegrityError: duplicate key value violates unique
 constraint "idx_18141_auth_permission_content_type_id_01ab375a_uniq"
 DETAIL:  Key (content_type_id, codename)=(12, add_agency) already exists`.

 It looks like the migration is trying to re-create already existing
 entries in the `auth_permission` table. At first I though it cloud because
 we recently renamed a model. But after digging and deleting the entries
 associated with the renamed model from our database in the
 `auth_permission` table, the problem still occurs with other proxy models.

 I tried to update directly from 2.0.13 and 2.1.8. The issues appeared each
 time. I also deleted my venv and recreated it without an effect.

 I searched for a ticket about this on the bug tracker but found nothing. I
 also posted this on [https://groups.google.com/forum/#!topic/django-
 users/KPnsJCgw8-U django-users] and was asked to report this here.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.d828c5339ee22f441a190c916b548b56%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.