From a82bc65192015e37276e8fe4e676f8042fd5fcbe Mon Sep 17 00:00:00 2001 From: Keith Mitchell Date: Fri, 9 Jan 2015 16:09:41 -0800 Subject: [PATCH] OAuth2 scopes: Space-separate multiple scopes --- r2/r2/models/token.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2/r2/models/token.py b/r2/r2/models/token.py index f2ee32bae..41cd8c0cd 100644 --- a/r2/r2/models/token.py +++ b/r2/r2/models/token.py @@ -265,14 +265,14 @@ class OAuth2Scope: else: self.subreddit_only = False self.subreddits = set() - self.scopes = set(scopes.split(',')) + self.scopes = set(scopes.replace(',', ' ').split(' ')) def __str__(self): if self.subreddit_only: sr_part = '+'.join(sorted(self.subreddits)) + ':' else: sr_part = '' - return sr_part + ','.join(sorted(self.scopes)) + return sr_part + ' '.join(sorted(self.scopes)) def has_access(self, subreddit, required_scopes): if self.FULL_ACCESS in self.scopes: