File tree Expand file tree Collapse file tree 3 files changed +2
-17
lines changed
Expand file tree Collapse file tree 3 files changed +2
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22from django .core .cache import cache
33from django .utils .translation import ugettext as _
44
5- from keyvaluestore .exceptions import KeyNotExistingException
6-
75class 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
Original file line number Diff line number Diff line change 11from keyvaluestore .models import KeyValueStore
2- from keyvaluestore .exceptions import KeyNotExistingException
3-
42
53def get_value_for_key (key ):
64 return KeyValueStore .objects .get_value_for_key (key )
@@ -9,7 +7,7 @@ def get_value_for_key(key):
97def 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
You can’t perform that action at this time.
0 commit comments