1. Christopher Grebs
  2. lodgeit-main

Commits

Ben  committed 399f60f

As if it will never end ...

  • Participants
  • Parent commits 2cd8bf8
  • Branches lodgeit

Comments (0)

Files changed (1)

File lodgeit/controllers/pastes.py

View file
         """Paginated list of pages."""
         def link(page):
             if page == 1:
-                return '/all/'
-            return '/all/%d' % page
+                return local.request.get_url('pastes/show_all')
+            return local.request.get_url('pastes/show_all', page=page)
 
         form_args = local.request.args
         query = Paste.find_all()
         if old_id is None:
             old_id = getform('old', '-1').lstrip('#')
             new_id = getform('new', '-1').lstrip('#')
-            return redirect('/compare/%s/%s' % (old_id, new_id))
+            return redirect(local.request.get_url('pastes/compare_paste', new_id=new_id, old_id=old_id))
 
         old = Paste.get(old_id)
         new = Paste.get(new_id)
         back to the page the user is coming from.
         """
         style_name = local.request.form.get('style')
-        resp = redirect(local.request.environ.get('HTTP_REFERER') or '/')
+        resp = redirect(local.request.environ.get('HTTP_REFERER') or local.request.get_url('pastes/new_paste'))
         if style_name in STYLES:
             resp.set_cookie('style', style_name)
         return resp
             if key == lang:
                 local.request.set_language(lang)
                 break
-        return redirect(local.request.headers.get('referer') or '/')
+        return redirect(local.request.headers.get('HTTP_REFERER') or local.request.get_url('pastes/new_paste'))
 
     def show_captcha(self):
         """Show a captcha."""