openelections / dashboard

Dashboard for The OpenElections Project.
MIT License
16 stars 4 forks source link

500 Error when adding a FOIA Log via the inline admin #20

Closed ghing closed 10 years ago

ghing commented 10 years ago

To replicate:

Expected result:

Log is added to state

Observed result:

500 Error.

Error dump:

Traceback:
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  372.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  202.             return view(request, *args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  223.                 return func(*args, **kwargs)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in change_view
  1106.                 self.save_related(request, form, formsets, True)
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in save_related
  764.             self.save_formset(request, form, formset, change=change)
File "/home/ghing/workspace/openelections-dashboard/dashboard/apps/hub/admin.py" in save_formset
  171.                 instance.user = request.user
File "/home/ghing/venvs/openelex-dash/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in __set__
  405.                                  self.field.name, self.field.rel.to._meta.object_name))

Exception Type: ValueError at /admin/hub/state/WA/
Exception Value: Cannot assign "<django.utils.functional.SimpleLazyObject object at 0x7f4447d13710>": "Log.user" must be a "ProxyUser" instance.
ghing commented 10 years ago

Addressed in 27d85a02da3a881b9f31200d3b9847e3cbcc1557

zstumgoren commented 10 years ago

This fix was deployed and verified to be working.