Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2018-06-03 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
-+-
 Reporter:  Sean Legassick   |Owner:  Tim
 |  Graham 
 Type:  Bug  |   Status:  closed
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * owner:  (none) => Tim Graham 
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"bec651a427fc032d9115d30c8c5d0e702d754f6c" bec651a]:
 {{{
 #!CommitTicketReference repository=""
 revision="bec651a427fc032d9115d30c8c5d0e702d754f6c"
 Fixed #10827 -- Ensured ContentTypes are created before permission
 creation.
 }}}

-- 
Ticket URL: 
Django 
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/063.504adbb9e691b3a55b3089a19db4d638%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2018-05-28 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
 Reporter:  Sean Legassick  |Owner:  (none)
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by Claude Paroz):

 * needs_tests:  1 => 0


Comment:

 [https://github.com/django/django/pull/10001 PR]

-- 
Ticket URL: 
Django 
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/063.3cb30ecca826c455b4c1568c8599ffe8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2018-03-19 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
 Reporter:  Sean Legassick  |Owner:  (none)
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Jared Proffitt):

 Michał's fix work for me as well. If I move
 `'django.contrib.contenttypes'` before `'django.contrib.auth'` in
 `INSTALLED_APPS`, it works.

 Would be nice to either have a fix that doesn't require that specific
 order of apps, or some documentation mentioning you need the specific app
 order.

-- 
Ticket URL: 
Django 
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/063.f581d1e20d77dc635323023522960e21%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2017-10-19 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
 Reporter:  Sean Legassick  |Owner:  (none)
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Michał Pasternak):

 Moving contenttypes apps before auth in INSTALLED_APPS fixed it.

-- 
Ticket URL: 
Django 
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/063.0d04c2a66c7f98928327b7d4d14304eb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2017-10-19 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
 Reporter:  Sean Legassick  |Owner:  (none)
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Michał Pasternak):

 I am having this problem with Django 1.11.5 and purest with pytest-django


 {{{
  ERROR at
 teardown of test_foo
 

 self = 

 def _commit(self):
 if self.connection is not None:
 with self.wrap_database_errors:
 >   return self.connection.commit()
 E   psycopg2.IntegrityError: BD:  wstawianie lub
 modyfikacja na tabeli "auth_permission" narusza klucz obcy
 "auth_permission_content_type_id_2f476e4b_fk_django_co"
 E   DETAIL:  Klucz (content_type_id)=(893) nie wyst��puje w
 tabeli "django_content_type".

 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/db/backends/base/base.py:236: IntegrityError

 The above exception was the direct cause of the following exception:

 self = 

 def _post_teardown(self):
 """Performs any post-test things. This includes:

 * Flushing the contents of the database, to leave a clean
 slate. If
   the class has an 'available_apps' attribute, post_migrate
 isn't fired.
 * Force-closing the connection, so the next test gets a clean
 cursor.
 """
 try:
 >   self._fixture_teardown()

 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/test/testcases.py:925:
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _ _ _
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/test/testcases.py:960: in _fixture_teardown
 inhibit_post_migrate=inhibit_post_migrate)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/core/management/__init__.py:131: in call_command
 return command.execute(*args, **defaults)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/core/management/base.py:330: in execute
 output = self.handle(*args, **options)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/core/management/commands/flush.py:88: in handle
 emit_post_migrate_signal(verbosity, interactive, database)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/core/management/sql.py:53: in emit_post_migrate_signal
 **kwargs
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/dispatch/dispatcher.py:193: in send
 for receiver in self._live_receivers(sender)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/dispatch/dispatcher.py:193: in 
 for receiver in self._live_receivers(sender)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/contrib/auth/management/__init__.py:83: in
 create_permissions
 Permission.objects.using(using).bulk_create(perms)
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/db/models/query.py:449: in bulk_create
 obj_without_pk._state.db = self.db
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/db/transaction.py:223: in __exit__
 connection.commit()
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/db/backends/base/base.py:262: in commit
 self._commit()
 ../../envs/django-bpp/lib/python3.6/site-
 packages/django/db/backends/base/base.py:236: in _commit
 return self.connection.commit()
 ../../envs/django-bpp/lib/python3.6/site-packages/django/db/utils.py:94:
 in __exit__
 six.reraise(dj_exc_type, dj_exc_value, traceback)
 ../../envs/django-bpp/lib/python3.6/site-packages/django/utils/six.py:685:
 in reraise
 raise value.with_traceback(tb)
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
 _ _ _ _ _ _

 self = 

 def _commit(self):
 if self.connection is not None:
 with self.wrap_database_errors:
 >   return self.connection.commit()
 E   django.db.utils.IntegrityError: BD:  wstawianie lub
 modyfikacja na tabeli "auth_permission" narusza klucz obcy
 "auth_permission_content_type_id_2f476e4b_fk_django_co"
 E   DETAIL:  Klucz (content_type_id)=(893) nie wyst��puje w
 tabeli "django_content_type".

 

Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2017-06-30 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
 Reporter:  Sean Legassick  |Owner:  (none)
 Type:  Bug |   Status:  new
Component:  contrib.auth|  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Lynn Cyrin):

 issue is still present in django 1.11.2

--
Ticket URL: 
Django 
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/063.08575ee8bde9d936f74f83974d2c6119%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2016-01-21 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by srkunze):

 @guettli @timgraham

 It just works. Nice. Thanks for that suggestion.

--
Ticket URL: 
Django 
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/063.1c8c1733e38a6da8891d621ccca96ab1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-11-11 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by teeberg):

 * cc: teeberg (added)


--
Ticket URL: 
Django 
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/063.91e25d8723dd3285ef8d8bbeaa478126%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-11-10 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by kvsn):

 * status:  assigned => new
 * owner:  kvsn =>


Comment:

 Don't forget to use a database that checks foreign key constraints instead
 of the default sqlite when trying to reproduce this bug.

--
Ticket URL: 
Django 
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/063.b13eb5d6c8f7778978ae4992f7d0bccb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-11-07 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  kvsn
 Type:  Bug   |   Status:  assigned
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by kvsn):

 * status:  new => assigned
 * owner:  nobody => kvsn


--
Ticket URL: 
Django 
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/063.e6a453ef6c40b2c8516b16637ff4efc9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-11-03 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by peterbe):

 I can confirm that this is still a bug in Django 1.7.
 I can't speak of the PR because I haven't studied it but making sure the
 order of the INSTALLED_APPS is right, as per
 http://stackoverflow.com/a/18292090/205832 did solve it for me.

--
Ticket URL: 
Django 
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/063.c2cb5a7320a54d2aedb42801d39e3b4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-08-24 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by guettli):

 I created a pull request: https://github.com/django/django/pull/5184

 It includes a test. Thanks to Tim Graham for the support.

 https://groups.google.com/d/msg/django-developers/CB4cGwBYo8o/7qcekYNeAgAJ

--
Ticket URL: 
Django 
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/063.dda6b12a3f435a21da367c6c775d0265%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-08-20 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by guettli):

 A work around is this line in your migration:

 {{{
 from django.contrib.contenttypes.models import ContentType

 class Migration(migrations.Migration):
 operations = [
 ...,
 migrations.RunPython(lambda apps, schema_editor:
 ContentType.objects.clear_cache()),
 ]

 }}}

--
Ticket URL: 
Django 
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/063.3bdbc18468ed470e70d8b6a969a6b691%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-08-20 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by guettli):

 The six years old patch solved the issue for me:

 {{{
 ContentType.objects.clear_cache()
 }}}

--
Ticket URL: 
Django 
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/063.cd2a18bcfd147dc0f027ddba2508096b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2015-08-20 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by guettli):

 I think this bug is still alive in Django1.7.

 I get this traceback:

 {{{
 File ".../django/core/management/__init__.py", line 385, in
 execute_from_command_line
   utility.execute()
 File ".../django/core/management/__init__.py", line 377, in execute
   self.fetch_command(subcommand).run_from_argv(self.argv)
 File ".../django/core/management/base.py", line 288, in run_from_argv
   self.execute(*args, **options.__dict__)
 File ".../django/core/management/base.py", line 338, in execute
   output = self.handle(*args, **options)
 File ".../django/core/management/commands/migrate.py", line 165, in handle
   emit_post_migrate_signal(created_models, self.verbosity,
 self.interactive, connection.alias)
 File ".../django/core/management/sql.py", line 268, in
 emit_post_migrate_signal
   using=db)
 File ".../django/dispatch/dispatcher.py", line 198, in send
   response = receiver(signal=self, sender=sender, **named)
 File ".../django/contrib/auth/management/__init__.py", line 117, in
 create_permissions
   Permission.objects.using(using).bulk_create(perms)
 File ".../django/db/models/query.py", line 410, in bulk_create
   self._batched_insert(objs_without_pk, fields, batch_size)
 File ".../django/db/transaction.py", line 339, in __exit__
   connection.commit()
 File ".../django/db/backends/__init__.py", line 176, in commit
   self._commit()
 File ".../django/db/backends/__init__.py", line 145, in _commit
   return self.connection.commit()
 File ".../django/db/utils.py", line 94, in __exit__
   six.reraise(dj_exc_type, dj_exc_value, traceback)
 File ".../django/db/backends/__init__.py", line 145, in _commit
   return self.connection.commit()

 django.db.utils.IntegrityError: insert or update on table
 "auth_permission" violates foreign key constraint
 "auth_content_type_id_508cf46651277a81_fk_django_content_type_id"
  DETAIL:  Key (content_type_id)=(1) is not present in table
 "django_content_type".


 }}}

--
Ticket URL: 
Django 
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/063.26b7710339b4d638e6c9dd6415f454cc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2014-08-29 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by jarus):

 * cc: jarus (added)


--
Ticket URL: 
Django 
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/063.dc0822d757248593d15dd32a82b07904%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2014-02-26 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by julen):

 * cc: julenx@… (added)


-- 
Ticket URL: 
Django 
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/063.65a47ec2e88af443929aa00db1d81d88%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2013-12-30 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by jorgecarleitao):

 * cc: jorgecarleitao (added)


-- 
Ticket URL: 
Django 
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/063.05810e24bd7c051d79ec6e53d7e73465%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2013-08-17 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by anonymous):

 I think I have run into the same problem while trying to use Selenium to
 test Django admin capabilities. When I try to update a user's permissions,
 I get the FK error. You can see [my code and issue on
 SO](http://stackoverflow.com/questions/18281137/selenium-django-gives-
 foreign-key-error). So I think this is still a present bug in Django 1.5.1
 / MySQL.

-- 
Ticket URL: 
Django 
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/063.3b4ae0866d30aca57485dc81c626e998%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2013-02-27 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by rjalves):

 Another duplicate: #6259

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2013-02-27 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by rjalves):

 * cc: rjalves@… (added)


Comment:

 The attached file is a fresh django project created with Django 1.4.5
 which allows reproducing the mentioned error.
 NOTE: This is not reproducible with the sqlite backend (MySQL was not
 tested but was reported to fail with InnoDB in other tickets #9207).

 Ticket #9207 is closed as fixed but due to lack of reproducibility. From
 the error it looks like a duplicate of the current.
 The workaround described on comment 3 from #9207 also solves the problem
 (putting contrib.contenttypes before contrib.auth in INSTALLED_APPS).

 PS: I don't know if there's any reason why INSTALLED_APPS has the current
 order but having django-admin.py invert the order could workaround this
 problem.

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2012-07-03 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by gcc):

 * cc: chris+django@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2012-07-03 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by gcc):

 +1. This just bit us as well.

 I think if flush is going to invalidate caches (which it appears to do),
 then it should be sending a signal that allows holders of caches to
 respond appropriately. So something like this in flush.py:

 {{{
 for app in set(all_models):
 models.signals.post_flush.send(sender=app, app=app,
 created_models=created_models, verbosity=verbosity,
 interactive=interactive, db=db)
 emit_post_sync_signal(set(all_models), verbosity, interactive, db)
 }}}

 Assuming a new signal `flush` which ContentTypeManager listens for, and
 then flushes its cache.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2012-05-17 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by anonymous):

 A workaround based on comment 7 is available here:
 http://djangosnippets.org/snippets/2752/

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2012-05-17 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
--+
 Reporter:  seanl |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by jodym@…):

 * cc: jodym@… (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2011-09-13 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+--
   Reporter:  seanl |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  contrib.auth
Version:  SVN   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  1
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+--
Changes (by orb@…):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 I'm having this problem too.  We worked around it by extending
 TransactionTestCase so that _pre_setup() invokes
 ContentType.objects.clear_cache().  I'd really love to see a solution to
 this.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2011-04-17 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
   Reporter:  seanl |Owner:  nobody
   Type:  Bug   |   Status:  new
  Milestone:|Component:  contrib.auth
Version:  SVN   | Severity:  Normal
 Resolution:| Keywords:
   Triage Stage:  Accepted  |Has patch:  1
Needs documentation:  0 |  Needs tests:  1
Patch needs improvement:  0 |
+
Changes (by julien):

 * needs_tests:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2011-04-08 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
+
   Reporter:  seanl |Owner:  nobody
   Type:  Bug   |   Status:  new
  Milestone:|Component:  contrib.auth
Version:  SVN   | Severity:  Normal
 Resolution:| Keywords:
   Triage Stage:  Accepted  |Has patch:  1
Needs documentation:  0 |  Needs tests:  0
Patch needs improvement:  0 |
+
Changes (by SmileyChris):

 * type:   => Bug
 * severity:   => Normal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2010-12-07 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
-+--
  Reporter:  seanl   | Owner:  nobody
Status:  new | Milestone:
 Component:  Authentication  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Comment (by PeterRussell):

 It seems that the reason that this happens is that the syncdb command is
 firing the post_syncdb signal for each application, as returned from
 get_apps() [source:/django/trunk/django/core/management/sql...@14849#l178
 here].  Get_apps appears to return apps in app-name order (see
 [source:/django/trunk/django/db/models/loading...@14849#l120 here]), and
 auth comes before contenttypes asciibetically.  It seems the right
 solution is probably to have a separate post_contenttypes_refreshed
 signal, and have create_permissions listen for that.  It would also be
 great if updating permissions could fire its own signal, so you can update
 groups etc based on that. (We've been having a somewhat similar issue).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2010-03-27 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
-+--
  Reporter:  seanl   | Owner:  nobody
Status:  new | Milestone:
 Component:  Authentication  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Comment (by Jason Yan ):

 I just got hit by this same issue and worked around it in a similar
 manner.  I instead removed the signal that was connected to
 update_contenttypes and moved the update_contenttypes call to
 django.core.management.commands.flush.

 For anyone that might be possibly searching for this, here's the exception
 from the tests without the fix:
 {{{
 IntegrityError: insert or update on table "auth_permission" violates
 foreign key constraint "content_type_id_refs_id_728de91f"
 DETAIL:  Key (content_type_id)=(2) is not present in table
 "django_content_type".
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2009-08-06 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
-+--
  Reporter:  seanl   | Owner:  nobody
Status:  new | Milestone:
 Component:  Authentication  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Accepted| Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by Alex):

  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10827: django.auth create_permissions must clear the content type cache before creating permissions

2009-04-15 Thread Django
#10827: django.auth create_permissions must clear the content type cache before
creating permissions
-+--
  Reporter:  seanl   | Owner:  nobody
Status:  new | Milestone:
 Component:  Authentication  |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Unreviewed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by seanl):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---