mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
snapshot: Fix showing unsupported message on non-btrfs filesystems
This is a regression from commit 9b6774f279. 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:
1 parent
740609c339
commit
bcb0823e7c
1 file changed
+7
@@ -58,6 +58,13 @@ class SnapshotAppView(AppView):
|
||||
template_name = 'snapshot.html'
|
||||
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):
|
||||
"""Return the values to fill in the form."""
|
||||
initial = super().get_initial()
|
||||
|
||||
Reference in new issue
Block a user