Skip to content

Commit 10966d7

Browse files
committed
Export package for correct vault in API
1 parent 7d8f2d2 commit 10966d7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

syncrypt/api/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def dispatch_export(self, request):
221221
if os.path.isdir(path):
222222
path = os.path.join(path, '{0}.zip'.format(vault.config.id))
223223

224-
yield from self.app.export_package(path)
224+
yield from self.app.export_package(path, vault=vault)
225225

226226
return JSONResponse({'status': 'ok', 'filename': path})
227227

syncrypt/app/syncrypt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,9 @@ def import_package(self, filename, target_folder, pull_vault=False):
563563
return vault
564564

565565
@asyncio.coroutine
566-
def export_package(self, filename):
567-
vault = self.vaults[0]
566+
def export_package(self, filename, vault=None):
567+
if vault is None:
568+
vault = self.vaults[0]
568569
export_pipe = vault.package_info()
569570
if filename is None:
570571
export_pipe = export_pipe >> StdoutWriter()

0 commit comments

Comments
 (0)