The google bot used the URL
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 29 Jun 2013 21:42:08 +0000 (21:42 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 29 Jun 2013 21:42:08 +0000 (21:42 +0000)
http://www.winterrodeln.org/feed/berichte/bahnen/22+42+132"""
to access the feed - that lead to a ValueError. Fixed.

git-svn-id: http://www.winterrodeln.org/svn/wrfeed/trunk@1485 7aebc617-e5e2-0310-91dc-80fb5f6d2477

setup.py
wrfeed/controllers/berichte.py

index 4a64a9a2f1ccee1465ecd835591dac1b0d4f5c0c..b960757fcaea427f4abb402aa83fe05375b2cf47 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -7,8 +7,8 @@ except ImportError:
 
 setup(
     name='wrfeed',
-    version='0.1.6',
-    description='Provides Atom Feed for Winterrodeln snow reports',
+    version='0.1.7',
+    description='Provides Atom Feed for Winterrodeln sledrun reports',
     author='Philipp Spitzer',
     author_email='philipp.spitzer@winterrodeln.org',
     url='http://www.winterrodeln.org/trac',
index 01d634c004820d80fcaf679ed27031172351cdec..e0814947fe8f1b23d2d75710b9c0210eab9926fd 100644 (file)
@@ -129,20 +129,32 @@ def create_feed(page_title=None, page_ids=None):
 class BerichteController(BaseController):
 
     def alle(self):
-        """http://www.winterrodeln.org/feed/berichte/alle"""
+        """Handles URLs like
+        http://127.0.0.1:5000/berichte/alle
+        http://www.winterrodeln.org/feed/berichte/alle
+        """
         response.content_type = 'application/atom+xml'
         return create_feed()
 
 
     def bahn(self, id):
-        """http://www.winterrodeln.org/feed/berichte/bahn/kemater_alm"""
+        """Handles URLs like
+        http://127.0.0.1:5000/berichte/bahn/kemater_alm
+        http://www.winterrodeln.org/feed/berichte/bahn/kemater_alm
+        """
         response.content_type = 'application/atom+xml'
         return create_feed(page_title=id)
 
 
     def bahnen(self, id):
-        """http://www.winterrodeln.org/feed/berichte/bahnen/22+42+132"""
+        """Handles URLs like
+        http://127.0.0.1:5000/berichte/bahnen/22+42+132
+        http://www.winterrodeln.org/feed/berichte/bahnen/22+42+132
+        """
         page_ids = id.split('+')
-        page_ids = [int(page_id) for page_id in page_ids]
+        try:
+            page_ids = [int(page_id) for page_id in page_ids]
+        except ValueError:
+            abort(400) # bad request
         response.content_type = 'application/atom+xml'
         return create_feed(page_ids=page_ids)