OAuth2 scopes: Space-separate multiple scopes

This commit is contained in:
Keith Mitchell
2015-01-09 16:09:41 -08:00
parent ad42be6c94
commit a82bc65192

View File

@@ -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: