Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

AttributeError at /admin/documents/document/ #416

Closed
goose-ws opened this issue Oct 3, 2018 · 5 comments
Closed

AttributeError at /admin/documents/document/ #416

goose-ws opened this issue Oct 3, 2018 · 5 comments

Comments

@goose-ws
Copy link

goose-ws commented Oct 3, 2018

When I pull up my /admin/documents/document/ I get the following error message:

Request Method: GET  
http://192.168.1.100:7412/admin/documents/document/  
1.11.13  
AttributeError  
'DocumentAdmin' object has no attribute 'get_changelist_instance'  
/home/goose/bin/paperless/src/documents/admin.py in changelist_view, line 212  
/usr/bin/python3  
3.5.3  
['/home/goose/bin/paperless/src',  '/usr/lib/python35.zip',  '/usr/lib/python3.5',  '/usr/lib/python3.5/plat-x86_64-linux-gnu',  '/usr/lib/python3.5/lib-dynload',  '/home/goose/.local/lib/python3.5/site-packages',  '/usr/local/lib/python3.5/dist-packages',  '/usr/lib/python3/dist-packages']  
Wed, 3 Oct 2018 15:57:10 +0000

image

Here is the traceback it provides:
http://dpaste.com/3ABY9YA.txt

I checked out issue #414 and #415 -- However, I don't believe it's a dates issue, as I originally had no documents at all and was getting the error. After processing in 3 documents, I see the dates as:

goose@eddard:~/bin/paperless/src$ echo "SELECT created, modified, added FROM  documents_document ORDER BY added" | ./manage.py dbshell  
2018-01-08 00:00:00|2018-10-03 15:56:34.695460|2018-10-03 15:56:34.695273  
2017-10-01 00:00:00|2018-10-03 15:56:38.391423|2018-10-03 15:56:38.391252  
2018-03-27 20:55:34.355462|2018-10-03 15:56:38.896063|2018-10-03 15:56:38.895864  
goose@eddard:~/bin/paperless/src$

Would thoroughly appreciate any help :)

@Forceu
Copy link

Forceu commented Oct 8, 2018

I have the same problem, the traceback is a followed:

Environment:


Request Method: GET
Request URL: http://banana:8000/admin/documents/document/

Django Version: 1.11.13
Python Version: 3.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'corsheaders',
 'django_extensions',
 'documents.apps.DocumentsConfig',
 'reminders.apps.RemindersConfig',
 'paperless_tesseract.apps.PaperlessTesseractConfig',
 'paperless_text.apps.PaperlessTextConfig',
 'django.contrib.admin',
 'rest_framework',
 'crispy_forms',
 'django_filters']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "/home/force/.local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/home/force/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/home/force/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/force/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in wrapper
  551.                 return self.admin_site.admin_view(view)(*args, **kwargs)

File "/home/force/.local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
  149.                     response = view_func(request, *args, **kwargs)

File "/home/force/.local/lib/python3.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)

File "/home/force/.local/lib/python3.5/site-packages/django/contrib/admin/sites.py" in inner
  224.             return view(request, *args, **kwargs)

File "/home/force/paperless/src/documents/admin.py" in changelist_view
  216.             cl = self.get_changelist_instance(request)

Exception Type: AttributeError at /admin/documents/document/
Exception Value: 'DocumentAdmin' object has no attribute 'get_changelist_instance'

This happened after upgrading to the current version with git pull and ./manage.py migrate. The webserver starts without any problems and all links apart from Documents work fine.

I do not have any invalid dates in the database and before the update it worked just fine.

The line in question references commit fb6f2e0

If I uncomment the following lines (215-217), the server is working normally:

if request.method == "GET":
       cl = self.get_changelist_instance(request)
       self.document_queue = [doc.id for doc in cl.queryset]

@danielquinn
Copy link
Collaborator

It looks like you're both running the wrong version of Django. Paperless upgraded to 2.x some time ago. Remember that part of the upgrade process is to update project dependencies with pipenv or pip:

pipenv

cd /path/to/paperless/root
pipenv install

pip

pip install -r /path/to/paperless/root/requirements.txt

If you do that, restart the webserver, and there's still a problem, let me know, and if not, please close this issue.

@danielquinn
Copy link
Collaborator

Update: I just realised that the migration docs didn't actually include a line about updating Python depdendencies, so yeah, this was my bad, sorry.

Anyway, I've added a note for them now, so if you remember to do the update, I'm reasonably sure you should be ok.

@Forceu
Copy link

Forceu commented Oct 8, 2018

Ah perfect, thank you very much. That did indeed fix the issue

@danielquinn
Copy link
Collaborator

\o/

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

No branches or pull requests

3 participants