Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-06-02 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (System checks)  |  Version:  1.10
 Severity:  Release blocker   |   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
--+

Comment (by Tim Graham ):

 In [changeset:"85d2b80d5e84aa16454a4cac187b91fec2ec4e48" 85d2b80d]:
 {{{
 #!CommitTicketReference repository=""
 revision="85d2b80d5e84aa16454a4cac187b91fec2ec4e48"
 [1.10.x] Fixed #26686 -- Fixed crash when registering model signals with
 abstract senders.

 Backport of 08014fe75b4fc379523f340191a02147ec35f7a3 from master
 }}}

--
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/064.87d641224521cc8d3c25d8a1fa8c7a59%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-06-02 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (System checks)  |  Version:  1.10
 Severity:  Release blocker   |   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 ):

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


Comment:

 In [changeset:"08014fe75b4fc379523f340191a02147ec35f7a3" 08014fe7]:
 {{{
 #!CommitTicketReference repository=""
 revision="08014fe75b4fc379523f340191a02147ec35f7a3"
 Fixed #26686 -- Fixed crash when registering model signals with abstract
 senders.
 }}}

--
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/064.532e141b9a0b3798d6190648f905ab54%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-31 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  1.10
 Severity:  Release blocker   |   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 AlexHill):

 * has_patch:  0 => 1


Comment:

 Pull request at https://github.com/django/django/pull/6678

--
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/064.bf495ad25799cb4c6ba1cf6a2130c265%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-31 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  1.10
 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
--+

Comment (by AlexHill):

 If you're only using abstract models, you shouldn't need to add to
 `INSTALLED_APPS`.
 
[https://github.com/django/django/blob/62e4f8ec435a4b600c8efb071201070a2443477e/django/db/models/base.py#L109
 This is explicitly allowed in models/base.py]

 I've found a bug in `ModelSignal`. It contains a conditional branch for
 senders of type `Model`, but it should be checking for `BaseModel`, since
 model signals are used with classes, not instances. Fixing that fixes this
 problem.

 The long version of what's happening is:
 * _lazy_model_operation works by waiting for models to be registered
 * abstract models are never registered with the app registry, so their
 operations will remain forever pending
 * [https://github.com/carljm/django-model-
 utils/blob/c94b65d05f4acd0437a22ef498a80470922a438a/model_utils/models.py#L54
 StatusModel is abstract, and has a MonitorField]
 * [https://github.com/carljm/django-model-
 utils/blob/c94b65d05f4acd0437a22ef498a80470922a438a/model_utils/fields.py#L106
 MonitorField connects to the `post_init` signal in its
 `contribute_to_class()` method]
 * signals use _lazy_model_operation as of 1.10
 * the bug means _lazy_model_operation is used by the `post_init` signal
 even when a model class is provided, not a string.

 Incidentally, we currently happily register model signals with abstract
 senders even though they'll never be sent. Since perfectly reasonable code
 like the linked code in django-model-utils does this, I don't think a
 warning is appropriate. I think we should just ignore them explicitly in
 ModelSignal and document that behaviour. Thoughts?

--
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/064.bc17db2d39a30f5f8bca269aeb580571%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-31 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  1.10
 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 timgraham):

 * cc: AlexHill (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Obviously it would be better not to crash, however, isn't it a requirement
 to put `model_utils` in `INSTALLED_APPS` if you want to use any models
 from it?

 After doing that with the sample project, this error is reported,
 `model_utils.fields: (signals.E001) Bound method
 'MonitorField._save_initial' was connected to the 'post_init' signal with
 a lazy reference to the sender 'model_utils.statusmodel', but app
 'model_utils' doesn't provide model 'statusmodel'.` I'm not sure if it's
 correct -- the model is there, although it's abstract (no problems with
 Django 1.9).

--
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/064.ec1f1ca0dc098f65340d98da51346df1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-30 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
-+-
 Reporter:  bretth   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (System |  Version:  1.10
  checks)|
 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 bretth):

 Attached my throwaway project. model-utils isn't in installed apps (it
 doesn't need to be)
 pip install django-model-utils (and django 1.10a).

 ./manage.py makemigrations demoapp
 {{{
 Traceback (most recent call last):
   File "./manage.py", line 22, in 
 execute_from_command_line(sys.argv)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/__init__.py", line 367, in
 execute_from_command_line
 utility.execute()
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/__init__.py", line 359, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/base.py", line 305, in run_from_argv
 self.execute(*args, **cmd_options)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/base.py", line 353, in execute
 self.check()
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/base.py", line 385, in check
 include_deployment_checks=include_deployment_checks,
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/management/base.py", line 372, in _run_checks
 return checks.run_checks(**kwargs)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/registry.py", line 81, in run_checks
 new_errors = check(app_configs=app_configs)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/model_checks.py", line 156, in
 check_lazy_references
 return _check_lazy_references(apps)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/model_checks.py", line 151, in
 _check_lazy_references
 )), key=lambda error: error.msg)
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/model_checks.py", line 150, in 
 for func in apps._pending_operations[model_key]
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/model_checks.py", line 145, in
 build_error
 return error_fn(model_key, func, args, keywords) if error_fn else None
   File "/Users/bretth/projects/_virtualenvs/django-typeerror/lib/python3.5
 /site-packages/django/core/checks/model_checks.py", line 117, in
 signal_connect_error
 'model': '.'.join(model_key or ''),
 TypeError: sequence item 0: expected str instance, NoneType found
 }}}

--
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/064.9b9b8ec907227edc7d095885785d942a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-30 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
-+-
 Reporter:  bretth   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (System |  Version:  1.10
  checks)|
 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 bretth):

 * Attachment "django-typeerror.zip" 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/064.fb38eec2e8301ba3572009a57c436f67%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-30 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
-+-
 Reporter:  bretth   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (System |  Version:  1.10
  checks)|
 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 timgraham):

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


Comment:

 Do you have `model_utils` in `INSTALLED_APPS`? Could you upload the
 minimal project to reproduce?

--
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/064.b789e223b4e0b4677bbb29303e5b99ae%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26686: django.core.checks.model_checks _check_lazy_references raises TypeError with NoneType model_key

2016-05-30 Thread Django
#26686: django.core.checks.model_checks _check_lazy_references raises TypeError
with NoneType model_key
--+
 Reporter:  bretth|  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  Core (System checks)  |Version:  1.10
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Steps for reproduction
 Create poll app or any model
 inherit model from django-model-utils model_utils.models.TimeStampedModel
 ./manage.py makemigrations

 In the model import process (None, 'statusmodel') erroneously gets added
 to the django.core.registry.App._pending_operations. StatusModel is a
 model in model_utils.models but is not imported into the poll app.

 django.core.checks.model_checks._check_lazy_references iterates over the
 model_key in _pending_operations but can't handle a model_key of NoneType
 so raises the TypeError.

 Being a defaultdict _pending_operations seems the point of weakness here.

--
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/049.c73c0bc695526fba180d4846056f63b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.