django admin The outermost 'atomic' block cannot use savepoint = False when autocommit is off
When I try to delete an item from a table generated by django admin, it throws this error
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/sybase_app/packageweight/?q=493
Django Version: 1.8
Python Version: 3.6.9
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
'sybase_app')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "/home/pd/.local/lib/python3.6/site-packages/django/core/handlers/base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/contrib/admin/options.py" in wrapper
616. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/contrib/admin/sites.py" in inner
233. return view(request, *args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapper
34. return bound_func(*args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/utils/decorators.py" in _wrapped_view
110. response = view_func(request, *args, **kwargs)
File "/home/pd/.local/lib/python3.6/site-packages/django/utils/decorators.py" in bound_func
30. return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/pd/.local/lib/python3.6/site-packages/django/contrib/admin/options.py" in changelist_view
1590. response = self.response_action(request, queryset=cl.get_queryset(request))
File "/home/pd/.local/lib/python3.6/site-packages/django/contrib/admin/options.py" in response_action
1333. response = func(self, request, queryset)
File "/home/pd/.local/lib/python3.6/site-packages/django/contrib/admin/actions.py" in delete_selected
49. queryset.delete()
File "/home/pd/.local/lib/python3.6/site-packages/django/db/models/query.py" in delete
537. collector.delete()
File "/home/pd/.local/lib/python3.6/site-packages/django/db/models/deletion.py" in delete
282. with transaction.atomic(using=self.using, savepoint=False):
File "/home/pd/.local/lib/python3.6/site-packages/django/db/transaction.py" in __enter__
164. "The outermost 'atomic' block cannot use "
Exception Type: TransactionManagementError at /admin/sybase_app/packageweight/
Exception Value: The outermost 'atomic' block cannot use savepoint = False when autocommit is off.
How can I fix it?
from Recent Questions - Stack Overflow https://ift.tt/3o5hYTv
https://ift.tt/eA8V8J
Comments
Post a Comment