Fixes for oauth login after programming basic tests

This commit is contained in:
Ozzieisaacs
2020-04-15 22:03:21 +02:00
parent ce4f1258b5
commit a784c6bd52
10 changed files with 450 additions and 385 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ try:
use_provider_user_id = True
if self.user_required and not u and not uid and not use_provider_user_id:
#raise ValueError("Cannot get OAuth token without an associated user")
# raise ValueError("Cannot get OAuth token without an associated user")
return None
# check for user ID
if hasattr(self.model, "user_id") and uid:
@@ -95,7 +95,7 @@ try:
def set(self, blueprint, token, user=None, user_id=None):
uid = first([user_id, self.user_id, blueprint.config.get("user_id")])
u = first(_get_real_user(ref, self.anon_user)
for ref in (user, self.user, blueprint.config.get("user")))
for ref in (user, self.user, blueprint.config.get("user")))
if self.user_required and not u and not uid:
raise ValueError("Cannot set OAuth token without an associated user")