More python 3 tweaks

This commit is contained in:
Lance Edgar 2018-02-12 22:17:38 -06:00
parent f411dcde24
commit 2ab00bfd78
2 changed files with 5 additions and 2 deletions

View file

@ -531,7 +531,7 @@ class BatchMasterView(MasterView):
def make_batch_row_grid_tools(self, batch): def make_batch_row_grid_tools(self, batch):
if self.rows_bulk_deletable and not batch.executed and self.request.has_perm('{}.delete_rows'.format(self.get_permission_prefix())): if self.rows_bulk_deletable and not batch.executed and self.request.has_perm('{}.delete_rows'.format(self.get_permission_prefix())):
url = self.request.route_url('{}.delete_rows'.format(self.get_route_prefix()), uuid=batch.uuid) url = self.request.route_url('{}.delete_rows'.format(self.get_route_prefix()), uuid=batch.uuid)
return HTML.tag('p', c=tags.link_to("Delete all rows matching current search", url)) return HTML.tag('p', c=[tags.link_to("Delete all rows matching current search", url)])
def make_row_grid_tools(self, batch): def make_row_grid_tools(self, batch):
return (self.make_default_row_grid_tools(batch) or '') + (self.make_batch_row_grid_tools(batch) or '') return (self.make_default_row_grid_tools(batch) or '') + (self.make_batch_row_grid_tools(batch) or '')

View file

@ -746,7 +746,10 @@ class MasterView(View):
return self.redirect(self.request.current_route_url(_query=None)) return self.redirect(self.request.current_route_url(_query=None))
if self.request.params.get('partial'): if self.request.params.get('partial'):
self.request.response.content_type = b'text/html' if six.PY3:
self.request.response.content_type = 'text/html'
else:
self.request.response.content_type = b'text/html'
self.request.response.text = grid.render_grid() self.request.response.text = grid.render_grid()
return self.request.response return self.request.response