mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
snapshot: Fix showing unsupported message on non-btrfs filesystems
This is a regression from commit 9b6774f279e2c8af588609c2413aa9804fd48cfa. When change the view to use AppView, the condition to check for non-btrfs filesystems and show an unsupported message instead of the actual view was accidentally removed. Restore the check and show a different view when on non-btrfs filesystems. Fixes: #2268. Tests: - On non-btrfs filesystem, snapshots view is shown as expected. - On ext4 filesystem, a message that snapshots are not supported is shown. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
740609c339
commit
bcb0823e7c
@ -58,6 +58,13 @@ class SnapshotAppView(AppView):
|
|||||||
template_name = 'snapshot.html'
|
template_name = 'snapshot.html'
|
||||||
form_class = SnapshotForm
|
form_class = SnapshotForm
|
||||||
|
|
||||||
|
def dispatch(self, request, *args, **kwargs):
|
||||||
|
"""If snapshots are not supported, use a different view."""
|
||||||
|
if not snapshot_module.is_supported():
|
||||||
|
return not_supported_view(request)
|
||||||
|
|
||||||
|
return super().dispatch(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
"""Return the values to fill in the form."""
|
"""Return the values to fill in the form."""
|
||||||
initial = super().get_initial()
|
initial = super().get_initial()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user