Commit 6fae4d5d authored by ibuler's avatar ibuler

[Bugfix] for some commit

parent 0c80e3e8
......@@ -16,13 +16,11 @@ class AuthSerializer(serializers.ModelSerializer):
return private_key, public_key
def save(self, **kwargs):
password = self.validated_data.pop('password') or None
private_key = self.validated_data.pop('private_key') or None
password = self.validated_data.pop('password', None) or None
private_key = self.validated_data.pop('private_key', None) or None
self.instance = super().save(**kwargs)
if password or private_key:
private_key, public_key = self.gen_keys(private_key, password)
self.instance.set_auth(password=password, private_key=private_key,
public_key=public_key)
return self.instance
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 to comment