summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIb Lundgren <ib.lundgren@gmail.com>2014-09-12 11:14:23 +0100
committerIb Lundgren <ib.lundgren@gmail.com>2014-09-12 11:14:23 +0100
commitf8eaaaad57e8e3430cb45304f1e749f3ae6f8620 (patch)
treeb97465e00081527869203c7cd43a26ead47c2187
parent80ada0db6ddade8fe31c641c59a8dff929ef019c (diff)
parent55d89cdcfd311add19d15aad975c949c1f3d8cf7 (diff)
downloadoauthlib-f8eaaaad57e8e3430cb45304f1e749f3ae6f8620.tar.gz
Merge pull request #263 from singingwolfboy/scope-change-warning-info
Make scope change warning more informative
-rw-r--r--oauthlib/oauth2/rfc6749/parameters.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/oauthlib/oauth2/rfc6749/parameters.py b/oauthlib/oauth2/rfc6749/parameters.py
index c27f3bf..5be5052 100644
--- a/oauthlib/oauth2/rfc6749/parameters.py
+++ b/oauthlib/oauth2/rfc6749/parameters.py
@@ -322,4 +322,9 @@ def validate_token_parameters(params, scope=None):
new_scope = params.get('scope', None)
scope = scope_to_list(scope)
if scope and new_scope and set(scope) != set(new_scope):
- raise Warning("Scope has changed to %s." % new_scope)
+ w = Warning("Scope has changed from {old} to {new}.".format(
+ old=scope, new=new_scope,
+ ))
+ w.old_scope = scope
+ w.new_scope = new_scope
+ raise w