]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/controllers/rodelbahn.py
Remove shebang in several files.
[philipp/winterrodeln/wradmin.git] / wradmin / controllers / rodelbahn.py
index 0b166fe8c272901651143ddc1ace0ff3c4a9c480..3671785ad89a2bf6638136551d4f626691c7ff69 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/python3.4
 from flask import request, abort, redirect, url_for, flash, render_template
 import paginate
 import sqlalchemy as sa
@@ -64,3 +63,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'))