Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
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:38:43 (GMT)
commit9d0d3720c167e1897fe5b9d055d1763710c507b8 (patch)
tree43cb6822392a8ef980a532b48aa5f72e51546484 /src
parentdc782bda31b590f89bd097d50dd8e6feb5575adc (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>
Diffstat (limited to 'src')
-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'])