Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2019-03-25 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
-+-
 Reporter:  Ed Morley|Owner:  Quentin
 Type:   |  Fulsher
  Cleanup/optimization   |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 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 ):

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


Comment:

 In [changeset:"d4df5e1b0b1c643fe0fc521add0236764ec8e92a" d4df5e1b]:
 {{{
 #!CommitTicketReference repository=""
 revision="d4df5e1b0b1c643fe0fc521add0236764ec8e92a"
 Fixed #27360 -- Added app or ModelAdmin details for AreadyRegistered
 exceptions.
 }}}

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2019-03-23 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
-+-
 Reporter:  Ed Morley|Owner:  Quentin
 Type:   |  Fulsher
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 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 Hasan Ramezani):

 * needs_better_patch:  1 => 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 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.f218fba153927298b8ac2a73fbc310f9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2017-01-17 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
-+-
 Reporter:  Ed Morley|Owner:  Quentin
 Type:   |  Fulsher
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Ed Morley):

 I've gone back to reproduce the original case in the ticket description,
 using:
 * b3740a2fdb80bf10276128cc51a77a7b107ea606 of
 https://github.com/mozilla/treeherder
 * A `vagrant up` followed by `pip install -U django-rest-swagger==2.0.5`
 * a `./manage.py runserver` and making a GET request to `/browserid/csrf/`

 I'm not sure if this appeared in the logs previously, but higher up in
 them I now see:
 `ImportError: No module named urls`

 ...from the `include('rest_framework_swagger.urls')` in:
 
https://github.com/mozilla/treeherder/blob/b3740a2fdb80bf10276128cc51a77a7b107ea606/treeherder/config/urls.py#L19

 Commenting out that line prevents the `AlreadyRegistered` exception
 (django-rest-swagger 2.x changed the method of registering URLs).
 I'm guessing this was some bad interaction between import order and
 django_browserid's copy_registry():
 https://github.com/mozilla/django-
 browserid/blob/v2.0.1/django_browserid/admin.py#L38-L39

 If I try the proposed PR (ie using `model._meta.label`) under this
 testcase, I get:
 `AttributeError: 'Options' object has no attribute 'label'`

 So I'm not 100% sure how best to improve the error message in this
 presumably rather rare edge-case, so perhaps not worth fixing this.
 (Though in the more common case discussed by others above, an improved
 error message may still be helpful?)

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2016-10-26 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
-+-
 Reporter:  Ed Morley|Owner:  Quentin
 Type:   |  Fulsher
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2016-10-23 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
-+-
 Reporter:  Ed Morley|Owner:  Quentin
 Type:   |  Fulsher
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 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 Quentin Fulsher):

 * cc: qfulsher@… (added)
 * status:  new => assigned
 * has_patch:  0 => 1
 * owner:  nobody => Quentin Fulsher


Comment:

 I made a pull request for this ticket here:
 https://github.com/django/django/pull/7423

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2016-10-19 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
--+
 Reporter:  Ed Morley |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  1.8
 Severity:  Normal|   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 Keryn Knight):

 * cc: django@… (added)


Comment:

 I'd think that providing the ModelAdmin label would be useful - the model
 is always going to be the one you're trying to register the "current"
 ModelAdmin for, so showing it's module or path is only going to be truly
 useful with multiple models of the same name?

 Perhaps something like:
 {{{AlreadyRegistered: Cannot use myapp.admin.SecondModelAdmin for
 myotherapp.MyModel, because myotherapp.admin.MyModelAdmin is already
 registered}}}

 Wording isn't perfect (for one thing, all of them say "AlreadyRegistered:
 ... already registered"), but you probably get the idea about surfacing as
 much information as possible.
 The previously registered ModelAdmin would have to be extracted from the
 `_registry` to get it's label, but that ought to be simple enough.

 I don't know whether shortening the model to {{{applabel.modelname}}} is
 better or worse than including it's actual module -- models are routinely
 referred to that way everywhere else, but given a ModelAdmin doesn't
 really have an applabel, that would ''have'' to show the full class
 name/module, so it might be inconsistent and confusing if the Model were
 shortened.

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2016-10-18 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
--+
 Reporter:  Ed Morley |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  1.8
 Severity:  Normal|   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 Quentin Fulsher):

 It might be a good idea to add the model's `__module__` field in front of
 the model name. Suppose for example I defined the model `UserModel` in
 `app1.models`. This would turn the resulting exception's message to
 `AlreadyRegistered: The model app1.models.Site is already registered`.
 Does this sound like a good addition?

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


Re: [Django] #27360: Make it easier to track down the offending models for AlreadyRegistered exceptions

2016-10-18 Thread Django
#27360: Make it easier to track down the offending models for AlreadyRegistered
exceptions
--+
 Reporter:  Ed Morley |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  1.8
 Severity:  Normal|   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 Tim Graham):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * type:  Uncategorized => Cleanup/optimization
 * needs_tests:   => 0
 * 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 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.99eff78a60161e5b2be88724285cd79b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.