Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_deleted_objects needs to be changed for admin view #135

Open
jangeja opened this issue Mar 29, 2020 · 1 comment
Open

get_deleted_objects needs to be changed for admin view #135

jangeja opened this issue Mar 29, 2020 · 1 comment

Comments

@jangeja
Copy link

jangeja commented Mar 29, 2020

Deleting an object on the admin view results in the following traceback:
`
Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/integration/analyzebeam/5e801b6ce5db3831a2ad80a4/delete/

Django Version: 2.1.7
Python Version: 3.7.7
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_mongoengine',
'django_mongoengine.mongo_auth',
'django_mongoengine.mongo_admin',
'integration']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
126. response = self.process_exception_by_middleware(e, request)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
124. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/contrib/admin/options.py" in wrapper
604. return self.admin_site.admin_view(view)(*args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
142. response = view_func(request, *args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/contrib/admin/sites.py" in inner
223. return view(request, *args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
142. response = view_func(request, *args, **kwargs)

File "/Users/jangeja/Projects/LexiconStructural/WoodBeamAnalysis/Infra/App/venv/lib/python3.7/site-packages/django_mongoengine/mongo_admin/options.py" in delete_view
405. [obj], request.user, self.admin_site, using)

Exception Type: TypeError at /admin/integration/analyzebeam/5e801b6ce5db3831a2ad80a4/delete/
Exception Value: get_deleted_objects() takes 3 positional arguments but 4 were given
`

Python Version:3.7.7
Django==2.1.7
django-mongoengine==0.4.1
djangorestframework==3.9.2
djangotoolbox==1.8.0
mongoengine==0.19.1
pymongo==3.10.1
pytz==2018.9
six==1.14.0

Looks like this commit changed that function and the django-mongoengine module needs to reflect this. This only pertains to the admin interface.

django/django@9822d88

last-partizan added a commit that referenced this issue Mar 29, 2020
@last-partizan
Copy link
Contributor

This must be fixed now.

But deletion still doesn't work properly becouse of error in django/contrib/admin/utils.py model_format_dict. Which i have no idea how to fix properly.

If you want this to work - ideas and pull-requests is welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants