Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11143 closed (duplicate)

AttributeError: 'str' object has no attribute '_default_manager'

Reported by: camilonova Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hi, since months ago i've getting sometimes this error:

Traceback (most recent call last):

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/handlers/base.py", line 83, in get_response
   request.path_info)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/urlresolvers.py", line 186, in resolve
   sub_match = pattern.resolve(new_path)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/urlresolvers.py", line 184, in resolve
   for pattern in self.url_patterns:

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/urlresolvers.py", line 208, in _get_url_patterns
   patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/urlresolvers.py", line 203, in _get_urlconf_module
   self._urlconf_module = import_module(self.urlconf_name)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/utils/importlib.py", line 35, in import_module
   __import__(name)

 File "/home/axiacore/webapps/atlantis/atlantis/local_apps/facturacion/urls.py", line 16, in <module>
   from atlantis.local_apps.facturacion.forms import PagoFacturaForm

 File "/home/axiacore/webapps/atlantis/atlantis/local_apps/facturacion/forms.py", line 5, in <module>
   class FacturaForm(forms.ModelForm):

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/models.py", line 201, in __new__
   opts.exclude, formfield_callback)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/models.py", line 165, in fields_for_model
   formfield = formfield_callback(f)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/models.py", line 183, in <lambda>
   lambda f: f.formfield())

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/db/models/fields/related.py", line 727, in formfield
   'queryset': self.rel.to._default_manager.complex_filter(

AttributeError: 'str' object has no attribute '_default_manager'

I get this only when i have DEBUG=False, when i have DEBUG=True it never happens. Also, it no only happen to that model, appears in any model, i get a feeling in how to reproduce it:

  1. Put your app in apache wsgi (i have it in webfaction)
  2. Try to enter a url who points to a view that have @login_required (Here the normal behavior is to redirect the user to login page, but sometimes, does not redirect, instead email me the error message*)
  3. When redirected to login page, you login, and then works as normally

Maybe its something when validating if the user is logged in for first time, but i dont have any idea, this is like the 20 error message that i get, so i consider it important.

Attachments (1)

error_log.txt (3.8 KB) - added by camilonova 5 years ago.
Error log mailed to me

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by camilonova

Error log mailed to me

comment:1 Changed 5 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Looks like #10405. You should be able to fix it in your code by following the advice noted in this comment:

http://code.djangoproject.com/ticket/10405#comment:10

comment:2 Changed 5 years ago by camilonova

Thanks, it works now.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.