Record valid scopes when raising InvalidScopeError

This commit is contained in:
Calen Pennington
2015-05-18 12:01:46 -04:00
parent 3e8631c214
commit bd1e9aa129
4 changed files with 21 additions and 10 deletions

View File

@@ -129,7 +129,7 @@ class DjangoKeyValueStore(KeyValueStore):
def _raise_unless_scope_is_allowed(self, key):
"""Raise an InvalidScopeError if key.scope is not in self._allowed_scopes."""
if key.scope not in self._allowed_scopes:
raise InvalidScopeError(key)
raise InvalidScopeError(key, self._allowed_scopes)
new_contract("DjangoKeyValueStore", DjangoKeyValueStore)