Explorar el Código

[fix] handle missing mapsettings

Adam Tauber hace 8 años
padre
commit
fa26afafd8
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      searx/preferences.py

+ 2
- 1
searx/preferences.py Ver fichero

@@ -130,7 +130,8 @@ class MapSetting(Setting):
130 130
         self.key = data
131 131
 
132 132
     def save(self, name, resp):
133
-        resp.set_cookie(name, bytes(self.key), max_age=COOKIE_MAX_AGE)
133
+        if hasattr(self, 'key'):
134
+            resp.set_cookie(name, bytes(self.key), max_age=COOKIE_MAX_AGE)
134 135
 
135 136
 
136 137
 class SwitchableSetting(Setting):