mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-15 09:51:21 +00:00
backups: Fix removing local repository
- Remove incorrect instantiation of SSH repository for local disk repositories. - Clarify the removal message to convey that backups are not removed. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
92abe9f3c1
commit
5136304212
@ -317,7 +317,6 @@ class BorgRepository(BaseBorgRepository):
|
||||
|
||||
def remove_repository(self):
|
||||
"""Remove a repository from the kvstore and delete its mountpoint"""
|
||||
self.umount()
|
||||
network_storage.delete(self.uuid)
|
||||
|
||||
|
||||
|
||||
@ -470,16 +470,16 @@ class RemoveRepositoryView(SuccessMessageMixin, TemplateView):
|
||||
"""Return additional context for rendering the template."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['title'] = _('Remove Repository')
|
||||
context['repository'] = SshBorgRepository(uuid=uuid)
|
||||
context['repository'] = create_repository(uuid)
|
||||
return context
|
||||
|
||||
def post(self, request, uuid):
|
||||
"""Delete the archive."""
|
||||
repository = SshBorgRepository(uuid)
|
||||
"""Delete the repository on confirmation."""
|
||||
repository = create_repository(uuid)
|
||||
repository.remove_repository()
|
||||
messages.success(
|
||||
request,
|
||||
_('Repository removed. The remote backup itself was not deleted.'))
|
||||
_('Repository removed. Backups were not deleted.'))
|
||||
|
||||
return redirect('backups:index')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user