Skip to content

Commit

Permalink
Provide a hook on the CRUD base class to allow overriding the default…
Browse files Browse the repository at this point in the history
… add url generation (#74)

* Provide a hook on the CRUD base class to allow overriding the default add url generation
* Remove Py27
  • Loading branch information
bladams authored and Nick Zaccardi committed Jul 28, 2019
1 parent feccb98 commit 75ec5b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion keg_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def render_grid(self):
return grid.export_as_response()

template_args = self.grid_template_args({
'add_url': flask.url_for(self.endpoint_for_action('add'), session_key=grid.session_key),
'add_url': self.add_url_with_session(grid.session_key),
'page_title': self.page_title(_('list')),
'page_heading': self.grid_page_heading,
'object_name': self.object_name,
Expand All @@ -238,6 +238,9 @@ def render_grid(self):

return flask.render_template(self.grid_template, **template_args)

def add_url_with_session(self, session_key):
return flask.url_for(self.endpoint_for_action('add'), session_key=session_key)

def cancel_url(self):
return self.list_url_with_session

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# and also to help confirm pull requests to this project.

[tox]
envlist = py{27,35,36}-{base,i18n},flake8,project
envlist = py{35,36,37}-{base,i18n},flake8,project


[testenv]
Expand Down

0 comments on commit 75ec5b1

Please sign in to comment.