Skip to content

Commit

Permalink
use request_param pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Apr 15, 2012
1 parent ec6cf90 commit 0ff42e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions substanced/site/views.py
Expand Up @@ -20,19 +20,19 @@ def __init__(self, context, request):
self.request = request

@mgmt_view(request_method='GET', tab_title='Manage DB')
def GET(self):
def view(self):
return {}

@mgmt_view(request_method='POST')
def POST(self):
@mgmt_view(request_method='POST', request_param='pack')
def pack(self):
check_csrf_token(self.request)
conn = get_connection(self.request)
try:
days = int(self.request.POST['days'])
except:
self.request.session.flash('Invalid number of days', 'error')
conn.db().pack(days=days)
self.request.session.flash('Database packed')
self.request.session.flash('Database packed to %s days' % days)
return HTTPFound(location=self.request.mgmt_path(
self.context, '@@manage_db'))

0 comments on commit 0ff42e1

Please sign in to comment.