#15230: django.db.backends.dummy.base.DatabaseWrapper has no attribute
'transaction_state'
-------------------------------------------------------------+--------------
 Reporter:  mp                                               |          Owner:  
nobody    
   Status:  new                                              |      Milestone:  
1.3       
Component:  Database layer (models, ORM)                     |        Version:  
SVN       
 Keywords:  DatabaseWrapper transaction_state dummy backend  |   Triage Stage:  
Unreviewed
Has patch:  1                                                |  
-------------------------------------------------------------+--------------
 == Steps to reproduce ==

 1. Start a new Django (r15438) project
 2. Add a URL mapping to a view that does not exist
 3. Start the development server
 4. Access the URL

 == Exception ==

 {{{
 Traceback (most recent call last):

   File "/tmp/django/core/servers/basehttp.py", line 282, in run
     self.result = application(self.environ, self.start_response)

   File "/tmp/django/contrib/staticfiles/handlers.py", line 68, in __call__
     return self.application(environ, start_response)

   File "/tmp/django/core/handlers/wsgi.py", line 273, in __call__
     response = self.get_response(request)

   File "/tmp/django/core/handlers/base.py", line 168, in get_response
     receivers = signals.got_request_exception.send(sender=self.__class__,
 request=request)

   File "/tmp/django/dispatch/dispatcher.py", line 172, in send
     response = receiver(signal=self, sender=sender, **named)

   File "/tmp/django/db/__init__.py", line 100, in _rollback_on_exception
     transaction.rollback_unless_managed(using=conn)

   File "/tmp/django/db/transaction.py", line 182, in
 rollback_unless_managed
     if not is_managed(using=using):

   File "/tmp/django/db/transaction.py", line 137, in is_managed
     if connection.transaction_state:

 AttributeError: 'DatabaseWrapper' object has no attribute
 'transaction_state'
 }}}

 == Patch ==

 {{{
 Index: db/backends/dummy/base.py
 ===================================================================
 --- db/backends/dummy/base.py   (revision 15438)
 +++ db/backends/dummy/base.py   (working copy)
 @@ -52,5 +52,8 @@
          self.settings_dict = settings_dict
          self.alias = alias

 +        self.transaction_state = []
 +
      def close(self):
          pass
 }}}

 == Discussion ==

 I checked {{{ django/db/backends/__init__.py }}} and there are some other
 attributes that might be relevant.

 This should be fixed for 1.3 as it renders Django unusable for Projects
 that do not need a database.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15230>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to