fusionbox / django-widgy

A CMS framework for Django built on a heterogenous tree editor.
http://wid.gy
Other
332 stars 52 forks source link

AttributeError in RevertView #371

Closed gradel closed 8 years ago

gradel commented 8 years ago
Internal Server Error: /admin/widgy/revert/1/1/
Traceback (most recent call last):
  File "/home/gerald/projects/mittelhof/mittelhof/env/lib/python3.4/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/gerald/projects/mittelhof/mittelhof/env/lib/python3.4/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.4/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/home/gerald/projects/mittelhof/mittelhof/env/lib/python3.4/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/gerald/projects/mittelhof/mittelhof/env/src/django-widgy/widgy/views/base.py", line 29, in dispatch
    return super(AuthorizedMixin, self).dispatch(request, *args, **kwargs)
  File "/home/gerald/projects/mittelhof/mittelhof/env/lib/python3.4/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/gerald/projects/mittelhof/mittelhof/env/lib/python3.4/site-packages/django/views/generic/edit.py", line 213, in get
    return self.render_to_response(self.get_context_data())
  File "/home/gerald/projects/mittelhof/mittelhof/env/src/django-widgy/widgy/views/versioning.py", line 201, in get_context_data
    kwargs['commit'] = self.object
AttributeError: 'RevertView' object has no attribute 'object'
[10/Apr/2016 19:45:40] "GET /admin/widgy/revert/1/1/ HTTP/1.1" 500 115014

All works great when I put the line self.object = self.get_object() in the get_context_data method of the RevertView class

gavinwahl commented 8 years ago

I think this was broken by django/django@8a1824d465a551b44376f17c01ef142cc036e863. Working on a fix now.