StephenPCG / django-adminlte-templates

MIT License
31 stars 18 forks source link

Python 3 compatibility #3

Open patvdleer opened 9 years ago

patvdleer commented 9 years ago

Please refrain from using has_key on dict objects, use in instead, see http://stackoverflow.com/questions/1323410/has-key-or-in

--- a/AdminLTE/settings.py
+++ b/AdminLTE/settings.py
@@ -20,13 +20,13 @@ def store_set(store, key, value, only_if_nonexist=False):
     frags = key.split('.')

     for frag in frags[:-1]:
-        if store.has_key(frag):
+        if frag in store.keys():
             store = store[frag]
         else:
             store[frag] = dict()
             store = store[frag]

-    if only_if_nonexist and store.has_key(frags[-1]):
+    if only_if_nonexist and frags[-1] in store.keys():
         return
     store[frags[-1]] = value