Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-05-25 16:28:31 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-05-31 14:40:33 (GMT)
commitbfc725ea04f482cc0aab8bf3c9206f07dd331427 (patch)
tree034e02274c38e6555367ac5a495455dc10f6bbb5
parent5cfb315d89eaa2fb21372f4fb545315bb28fb1e0 (diff)
Raise alert when trying to send an entry without an associated file OLPC #10798
We raise the same error when we try to copy an entry without an associated file to an external device. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-By: Sascha Silbe <silbe@activitycentral.com>
-rw-r--r--src/jarabe/journal/palettes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
index 9ae1afb..d40ec21 100644
--- a/src/jarabe/journal/palettes.py
+++ b/src/jarabe/journal/palettes.py
@@ -143,6 +143,13 @@ class ObjectPalette(Palette):
logging.debug('__friend_selected_cb')
file_name = model.get_file(self._metadata['uid'])
+ if not file_name or not os.path.exists(file_name):
+ logging.warn('Entries without a file cannot be sent.')
+ self.emit('volume-error',
+ _('Entries without a file cannot be sent.'),
+ _('Warning'))
+ return
+
title = str(self._metadata['title'])
description = str(self._metadata.get('description', ''))
mime_type = str(self._metadata['mime_type'])