]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
rodelbahn_update works now.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 30 Jul 2017 21:25:18 +0000 (21:25 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 30 Jul 2017 21:25:18 +0000 (21:25 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2685 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/__init__.py
wradmin/controllers/rodelbahn.py

index 8a35e9dd27074222260aad3fbfe632e3c320f5ae..4e989206d5c122bf1e8c7be353cd711377425a46 100644 (file)
@@ -43,17 +43,18 @@ def rodelbahn_list():
     return RodelbahnController().list()
 
 
     return RodelbahnController().list()
 
 
-@app.route("/rodelbahn/update")
-def rodelbahn_update():
-    pass
-
-
 @app.route("/rodelbahn/view/<int:id>")
 def rodelbahn_view(id):
     get_db()
     return RodelbahnController().view(id)
 
 
 @app.route("/rodelbahn/view/<int:id>")
 def rodelbahn_view(id):
     get_db()
     return RodelbahnController().view(id)
 
 
+@app.route("/rodelbahn/update")
+def rodelbahn_update():
+    get_db()
+    return RodelbahnController().update()
+
+
 @app.route("/rodelbahn/update_regioncache")
 def rodelbahn_update_regioncache():
     pass
 @app.route("/rodelbahn/update_regioncache")
 def rodelbahn_update_regioncache():
     pass
index ab67570ecfd1bf797607d8d7ad50d5839fc369ba..5af866ecd80633439c3a9709fe08e1569f0e0f04 100644 (file)
@@ -1,7 +1,5 @@
 #!/usr/bin/python3.4
 #!/usr/bin/python3.4
-#from pylons import request, response, session, url, tmpl_context as c
-#from pylons.controllers.util import abort, redirect
-from flask import request, abort, url_for
+from flask import request, abort, redirect, session, url_for
 import paginate
 import sqlalchemy as sa
 
 import paginate
 import sqlalchemy as sa
 
@@ -40,7 +38,7 @@ class RodelbahnController:
         return render_genshi_template('rodelbahn_view.html', c=c)
 
     def update(self):
         return render_genshi_template('rodelbahn_view.html', c=c)
 
     def update(self):
-        "Updates the wrsledruncache table from the wiki"
+        """Updates the wrsledruncache table from the wiki"""
         c = model.meta.Session.connection()
         try:
             wrpylib.wrmwcache.update_wrsledruncache(c)
         c = model.meta.Session.connection()
         try:
             wrpylib.wrmwcache.update_wrsledruncache(c)
@@ -53,10 +51,8 @@ class RodelbahnController:
             msg = msg.replace('\n', '; ')
             if len(e.args) == 3: session['flash'] = "Fehler bei Rodelbahn '{0}': {1}".format(title, msg)
             else: session['flash'] = str(e)
             msg = msg.replace('\n', '; ')
             if len(e.args) == 3: session['flash'] = "Fehler bei Rodelbahn '{0}': {1}".format(title, msg)
             else: session['flash'] = str(e)
-        session.save()
         # Redirect to result page
         # Redirect to result page
-        return redirect(url(controller='rodelbahn', action='list'))
-
+        return redirect(url_for('rodelbahn_list'))
 
     def update_regioncache(self):
         "Updates the wrregioncache table from the wiki"
 
     def update_regioncache(self):
         "Updates the wrregioncache table from the wiki"