Revert "Disable view mode for settings table"

This reverts commit 457407fbcf.
This commit is contained in:
Lance Edgar 2016-08-12 17:18:22 -05:00
parent a6438e4bb5
commit 498a810f08
2 changed files with 1 additions and 18 deletions

View file

@ -647,15 +647,12 @@ class MasterView(View):
if self.creating:
kwargs.setdefault('cancel_url', self.get_index_url())
else:
kwargs.setdefault('cancel_url', self.get_cancel_url(instance))
kwargs.setdefault('cancel_url', self.get_action_url('view', instance))
factory = kwargs.pop('factory', forms.AlchemyForm)
form = factory(self.request, fieldset, **kwargs)
form.readonly = self.viewing
return form
def get_cancel_url(self, instance):
return self.get_action_url('view', instance)
def save_form(self, form):
form.save()

View file

@ -36,7 +36,6 @@ class SettingsView(MasterView):
Master view for the settings model.
"""
model_class = model.Setting
viewable = False
def configure_grid(self, g):
g.filters['name'].default_active = True
@ -49,19 +48,6 @@ class SettingsView(MasterView):
],
readonly=True)
def get_grid_actions(self):
# TODO: bit of a hack, but gets the job done
return self.get_more_actions(), []
def get_cancel_url(self, setting):
return self.get_index_url()
def redirect_after_create(self, setting):
return self.redirect(self.get_index_url())
def redirect_after_edit(self, setting):
return self.redirect(self.get_index_url())
def configure_fieldset(self, fs):
fs.configure(
include=[