Commits

Gregory Petukhov committed 969a2af

Fix bugs

  • Participants
  • Parent commits ead36ac

Comments (0)

Files changed (4)

 Update settings.py:
  * Add 'trustlink.django' to INSTALLED_APPS
  * Add required settings (see below)
- * Use following
-
-
-Usage in templates:
-
-    {% load trustlink_tags %}
-    {% trustlink_links %}
 
 
 Settings
 TRUSTLINK_HOST - hostname of website
 TRUSTLINK_USER - ID of your trustlink.ru account
 TRUSTLINK_TEST (optional, default Fase) - explicitly set test mode
+
+
+Usage in templates
+------------------
+
+    {% load trustlink_tags %}
+    {% trustlink_links %}
+
+
+Cron
+----
+
+Add to your crontab:
+*/10    *   *   *   *   cd /path/to/project; ./manage.py trustlink_update

trustlink/client.py

         def get(key, default=None):
             val = db.get(key)
             if val is not None:
-                return json.loads(val)
+                val_decoded = json.loads(val)
+                if isinstance(val_decoded, dict):
+                    val_decoded = val_decoded.values()
+                return val_decoded
             else:
                 return default
 
                 prepend += start
 
 
+
         if self.test:
             links = [
                 get('__test_tl_link__', []),