fix import state before import started

This commit is contained in:
j 2016-01-25 12:18:24 +05:30
commit ceffe456db
3 changed files with 16 additions and 11 deletions

View file

@ -328,9 +328,12 @@ def _import(data):
mode copy|move
}
'''
if 'cancel' in state.activity:
del state.activity['cancel']
state.tasks.queue('import', data)
if os.path.exists(data['path']):
state.activity = {
'activity': 'import',
'path': data['path'],
}
state.tasks.queue('import', data)
return {}
actions.register(_import, 'import', cache=False)