strip instead of trim

This commit is contained in:
PCoder 2017-09-13 06:27:46 +05:30
parent 662219f524
commit ee5150dc6e

View file

@ -94,7 +94,7 @@ class UserHostingKeyForm(forms.ModelForm):
if 'generate' in self.request.POST:
return self.data.get('public_key')
KEY_ERROR_MESSAGE = _("Please input a proper SSH key")
openssh_pubkey_str = self.data.get('public_key').trim()
openssh_pubkey_str = self.data.get('public_key').strip()
with tempfile.NamedTemporaryFile(delete=True) as tmp_public_key_file:
tmp_public_key_file.write(openssh_pubkey_str.encode('utf-8'))