islco / django-rq-scheduler

A database backed job scheduler for Django RQ and RQ Scheduler
MIT License
42 stars 46 forks source link

Can't disable repeatable job from django-admin list view #19

Closed cunla closed 6 years ago

cunla commented 7 years ago

When trying to disable a job from django-admin repeatable jobs list view and saving I get an error 'RepeatableJobForm' has no field named 'callable'.

Full stack trace:

Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/scheduler/repeatablejob/

Django Version: 1.11.6
Python Version: 2.7.14
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'daterange_filter',
 'django_rq',
 'scheduler',
 'rest_framework',
 'rest_framework.authtoken',
 'babycroinc',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'logentry_admin',
 'allauth.socialaccount.providers.facebook',
 'inline_actions',
 'notifications',
 'rest_framework_swagger',
 'tinymce',
 'ajax_select')
Installed Middleware:
('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',
 'babycroinc.middleware.BabyCroincMiddleware')

Traceback:

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
  249.             response = self._get_response(request)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  551.                 return self.admin_site.admin_view(view)(*args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  149.                     response = view_func(request, *args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  224.             return view(request, *args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  67.             return bound_func(*args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  149.                     response = view_func(request, *args, **kwargs)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  63.                 return func.__get__(self, type(self))(*args2, **kwargs2)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  1605.             if formset.is_valid():

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/formsets.py" in is_valid
  321.         self.errors

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/formsets.py" in errors
  295.             self.full_clean()

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/formsets.py" in full_clean
  349.             self._errors.append(form.errors)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/forms.py" in errors
  175.             self.full_clean()

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/forms.py" in full_clean
  386.         self._post_clean()

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/models.py" in _post_clean
  415.             self._update_errors(e)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/models.py" in _update_errors
  389.         self.add_error(None, errors)

File "/Users/style/PycharmProjects/babycroinc/env/lib/python2.7/site-packages/django/forms/forms.py" in add_error
  352.                         "'%s' has no field named '%s'." % (self.__class__.__name__, field))

Exception Type: ValueError at /admin/scheduler/repeatablejob/
Exception Value: 'RepeatableJobForm' has no field named 'callable'.
oudeismetis commented 6 years ago

@cunla Sorry for the slow reply. There are some open PRs that might address this. I'm taking an action to attempt to reproduce myself. If it's still an issue I'll try to open a PR for it.

Thanks!

tom-price commented 6 years ago

@oudeismetis, I've not been able to repeat this issue. I tested on Python 2.7.15 with the minimums currently defined in setup.py:

cunla commented 6 years ago

Updating packages fixed this

oudeismetis commented 6 years ago

thanks @tom-price !