seibert-media/teamvault

Can't edit secrets

Closed this issue · 0 comments

vain commented

Create a secret (specify "Name" and "Password"), then try to edit it. That's what you get:

Environment:


Request Method: POST
Request URL: http://10.33.20.2/secrets/2/edit

Django Version: 1.7.2
Python Version: 3.4.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.formtools',
 'django.contrib.humanize',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_gravatar',
 'rest_framework',
 'teamvault.apps.accounts.AccountsConfig',
 'teamvault.apps.audit.AuditConfig',
 'teamvault.apps.secrets.SecretsConfig',
 'teamvault.apps.settings.SettingsConfig']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/contrib/auth/decorators.py" in _wrapped_view
  22.                 return view_func(request, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/views/generic/base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "/srv/teamvault/src/teamvault/apps/secrets/views.py" in post
  264.         return super(SecretEdit, self).post(request, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/views/generic/edit.py" in post
  230.         return super(BaseUpdateView, self).post(request, *args, **kwargs)
File "/usr/lib/python3.4/site-packages/Django-1.7.2-py3.4.egg/django/views/generic/edit.py" in post
  173.             return self.form_valid(form)
File "/srv/teamvault/src/teamvault/apps/secrets/views.py" in form_valid
  227.         secret.set_data(self.request.user, plaintext_data)

Exception Type: UnboundLocalError at /secrets/2/edit
Exception Value: local variable 'plaintext_data' referenced before assignment