From 74e3415515bf750d57da37bec4eaeaeaaa69fe89 Mon Sep 17 00:00:00 2001 From: lraccomando Date: Wed, 14 May 2014 12:12:52 -0400 Subject: [PATCH] Wrote doc string for new storage parameter. Added proper doctoring for the overwrite parameter in Django ORM storage and updated an unused variable. --- oauth2client/django_orm.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/oauth2client/django_orm.py b/oauth2client/django_orm.py index 07acebd..40053af 100644 --- a/oauth2client/django_orm.py +++ b/oauth2client/django_orm.py @@ -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()