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

object has no attribute '_changed_fields' #51

Closed
laurentpayot opened this issue Aug 9, 2013 · 1 comment
Closed

object has no attribute '_changed_fields' #51

laurentpayot opened this issue Aug 9, 2013 · 1 comment

Comments

@laurentpayot
Copy link
Contributor

After commit 5cb3a5b (fixing #48) I get the following internal server error when posting forms:

Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/django/core/handlers/base.py", line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
  File "/opt/myproject/django/www/views.py", line 426, in dispatch
    return super().dispatch(*args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/views/generic/edit.py", line 228, in post
    return super(BaseUpdateView, self).post(request, *args, **kwargs)
  File "/usr/local/lib/python3.3/dist-packages/django/views/generic/edit.py", line 170, in post
    if form.is_valid():
  File "/usr/local/lib/python3.3/dist-packages/django/forms/forms.py", line 129, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/usr/local/lib/python3.3/dist-packages/django/forms/forms.py", line 121, in errors
    self.full_clean()
  File "/usr/local/lib/python3.3/dist-packages/django/forms/forms.py", line 275, in full_clean
    self._post_clean()
  File "/usr/local/lib/python3.3/dist-packages/mongodbforms-0.2.2-py3.3.egg/mongodbforms/documents.py", line 396, in _post_clean
    f.name not in self.instance._changed_fields:
AttributeError: 'Book' object has no attribute '_changed_fields'

So I'm sticking to fb57c72 and everything is fine with this old one.

@jschrewe
Copy link
Owner

jschrewe commented Aug 9, 2013

Did you change anything on the document? I think that's the only thing I didn't really test. It should handle the missing attribute gracefully now though and completely fall back to the old behaviour.

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