]> 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 71e633f424b69c4800c52e8cfefb6eb6e29f6223..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
@@ -43,7 +42,7 @@ class RodelbahnController:
             flash('Die Rodelbahnliste wurde erfolgreich aktualisiert.', 'info')
         except wrpylib.wrmwcache.UpdateCacheError as e:
             title = str(e.args[1])
-            title = wrpylib.mwmarkup.to_title(title)
+            title = wrpylib.mwmarkup.dbkey_to_title(title)
             msg = str(e.args[2])
             msg = msg.replace('\n', '; ')
             if len(e.args) == 3:
@@ -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'))