backends.py: Don't pass mutable default arguments.

Values of mutable default arguments are shared across all function
invocations. See
https://pythonconquerstheuniverse.wordpress.com/2012/02/15/mutable-default-arguments/
for further details.
This commit is contained in:
Umair Khan 2017-03-24 12:45:21 +05:00 committed by Tim Abbott
parent 7bcf24d39c
commit f7860bca48
1 changed files with 5 additions and 2 deletions

View File

@ -266,8 +266,11 @@ class GoogleMobileOauth2Backend(ZulipAuthMixin):
"""
def authenticate(self, google_oauth2_token=None, realm_subdomain=None, return_data={}):
# type: (Optional[str], Optional[Text], Dict[str, Any]) -> Optional[UserProfile]
def authenticate(self, google_oauth2_token=None, realm_subdomain=None, return_data=None):
# type: (Optional[str], Optional[Text], Optional[Dict[str, Any]]) -> Optional[UserProfile]
if return_data is None:
return_data = {}
try:
token_payload = googleapiclient.verify_id_token(google_oauth2_token, settings.GOOGLE_CLIENT_ID)
except AppIdentityError: