Revert "Disable view mode for settings table"
This reverts commit 457407fbcf
.
This commit is contained in:
parent
a6438e4bb5
commit
498a810f08
|
@ -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()
|
||||
|
||||
|
|
|
@ -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=[
|
||||
|
|
Loading…
Reference in a new issue