Skip to content

Commit 88f25b1

Browse files
committed
Merge exception cleanup
2 parents f4a7ad2 + d1a3edb commit 88f25b1

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

keyvaluestore/exceptions.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

keyvaluestore/managers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
from django.core.cache import cache
33
from django.utils.translation import ugettext as _
44

5-
from keyvaluestore.exceptions import KeyNotExistingException
6-
75
class KeyValueStoreManager(models.Manager):
86
def get_value_for_key(self, key):
97
key = key.upper()
@@ -17,6 +15,6 @@ def get_value_for_key(self, key):
1715

1816
return obj.value
1917
except:
20-
raise KeyNotExistingException(_(u"The request key '%s' could not be found." % (key,)))
18+
raise KeyError(_(u"The request key '%s' could not be found." % (key,)))
2119
else:
2220
return cached

keyvaluestore/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from keyvaluestore.models import KeyValueStore
2-
from keyvaluestore.exceptions import KeyNotExistingException
3-
42

53
def get_value_for_key(key):
64
return KeyValueStore.objects.get_value_for_key(key)
@@ -9,7 +7,7 @@ def get_value_for_key(key):
97
def get_value_or_default(key, default):
108
try:
119
value = get_value_for_key(key)
12-
except KeyNotExistingException:
10+
except KeyError:
1311
value = default
1412
return value
1513

0 commit comments

Comments
 (0)