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

Error with collectstatic #18

Closed
askerka opened this issue Apr 14, 2018 · 3 comments
Closed

Error with collectstatic #18

askerka opened this issue Apr 14, 2018 · 3 comments

Comments

@askerka
Copy link

askerka commented Apr 14, 2018

  File "/home/a-askerka/Projects/offerwall/venv/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/a-askerka/Projects/offerwall/venv/lib/python3.6/site-packages/django_apscheduler/models.py", line 17, in get_queryset
    self.__ping()
  File "/home/a-askerka/Projects/offerwall/venv/lib/python3.6/site-packages/django_apscheduler/models.py", line 28, in __ping
    self.__reconnect()
  File "/home/a-askerka/Projects/offerwall/venv/lib/python3.6/site-packages/django_apscheduler/models.py", line 34, in __reconnect
    connection.connection.close()
AttributeError: 'NoneType' object has no attribute 'close'

django==2.0.4
django-apscheduler==0.2.6
python==3.6

I'm tried collect static without any db connection.

@sallyruthstruik
Copy link
Collaborator

@asduj I have problem with reproducing. If you got in this function, it means you called DjangoJobManager. But it makes no sense if you run collectstatic, and if you have no connection.

@sallyruthstruik
Copy link
Collaborator

Oh, got it. queryset is lazy, so Django gets queryset on models initialization

@sallyruthstruik
Copy link
Collaborator

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