]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/controllers/rodelbahn.py
Implement update_wrmapcache functionality from GUI.
[philipp/winterrodeln/wradmin.git] / wradmin / controllers / rodelbahn.py
index 0b166fe8c272901651143ddc1ace0ff3c4a9c480..f6bd26d31acdc342f3bb7ff8c4890e2bfe0e5f28 100644 (file)
@@ -64,3 +64,15 @@ class RodelbahnController:
             flash(str(e), 'error')
         # Redirect to result page
         return redirect(url_for('rodelbahn_list'))
+
+    def update_mapcache(self):
+        """Updates the wrmappointcache and wrmappathcache tables from the wiki."""
+        c = model.meta.Session.connection()
+        try:
+            wrpylib.wrmwcache.update_wrmapcache(c)
+            model.meta.Session.commit()
+            flash('Die Landkarteninformationen aus dem Wiki wurden erfolgreich aktualisiesrt.', 'info')
+        except wrpylib.wrmwcache.UpdateCacheError as e:
+            flash(str(e), 'error')
+        # Redirect to result page
+        return redirect(url_for('rodelbahn_list'))