Wrote doc string for new storage parameter.
Added proper doctoring for the overwrite parameter in Django ORM storage and updated an unused variable.
This commit is contained in:
@@ -121,14 +121,16 @@ class Storage(BaseStorage):
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
credentials: Credentials, the credentials to store.
|
credentials: Credentials, the credentials to store.
|
||||||
|
overwrite: Boolean, indicates whether you would like these credentials to
|
||||||
|
overwrite any existing stored credentials.
|
||||||
"""
|
"""
|
||||||
args = {self.key_name: self.key_value}
|
args = {self.key_name: self.key_value}
|
||||||
|
|
||||||
if overwrite:
|
if overwrite:
|
||||||
entity, is_new = self.model_class.objects.get_or_create(**args)
|
entity, unused_is_new = self.model_class.objects.get_or_create(**args)
|
||||||
else:
|
else:
|
||||||
entity = self.model_class(**args)
|
entity = self.model_class(**args)
|
||||||
|
|
||||||
setattr(entity, self.property_name, credentials)
|
setattr(entity, self.property_name, credentials)
|
||||||
entity.save()
|
entity.save()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user