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:
lraccomando
2014-05-14 12:12:52 -04:00
parent e2e988f8d6
commit 74e3415515

View File

@@ -121,14 +121,16 @@ class Storage(BaseStorage):
Args:
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}
if overwrite:
entity, is_new = self.model_class.objects.get_or_create(**args)
else:
if overwrite:
entity, unused_is_new = self.model_class.objects.get_or_create(**args)
else:
entity = self.model_class(**args)
setattr(entity, self.property_name, credentials)
entity.save()