Commit 1fc70d80 by Paul Kilgo

use clean_key instead of clean

parent 0f3d40f4
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from django import forms from django import forms
from django.core.exceptions import ValidationError
from django_sshkey.models import Key, UserKey from django_sshkey.models import Key, UserKey
from django_sshkey.util import pubkey_parse from django_sshkey.util import pubkey_parse
...@@ -40,12 +41,11 @@ class ApplicationKeyForm(forms.ModelForm): ...@@ -40,12 +41,11 @@ class ApplicationKeyForm(forms.ModelForm):
}) })
) )
def clean(self): def clean_key(self):
cleaned_data = self.cleaned_data key = self.cleaned_data['key']
if 'key' in cleaned_data: key = Key(key=key)
key = cleaned_data['key'] = Key(key=cleaned_data['key']) key.full_clean()
key.full_clean() return key
return cleaned_data
def save(self, commit=True): def save(self, commit=True):
instance = super(ApplicationKeyForm, self).save(commit=False) instance = super(ApplicationKeyForm, self).save(commit=False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment