summaryrefslogtreecommitdiff
path: root/alot/commands
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-05-08 17:14:56 +0200
committerAnton Khirnov <anton@khirnov.net>2020-05-09 15:27:23 +0200
commit9578a7245ff7b705e8531014994025cdc4f1b154 (patch)
tree1b37a379a94c6cf7a42bd8809baf6df4270f9fe7 /alot/commands
parent4c02a40d5dcec1fba988aa626da2dd0d9a058abd (diff)
ExitCommand: do not flush the db if it is opened read-only.
Diffstat (limited to 'alot/commands')
-rw-r--r--alot/commands/globals.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 1104bd10..1c9bacea 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -73,7 +73,10 @@ class ExitCommand(Command):
for b in ui.buffers:
b.cleanup()
- await ui.apply_command(FlushCommand(callback=ui.exit))
+ if ui.dbman.ro:
+ ui.exit()
+ else:
+ await ui.apply_command(FlushCommand(callback=ui.exit))
ui.cleanup()
if ui.db_was_locked: