Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-01-04 11:09:04 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-01-04 11:09:04 (GMT)
commit2395395fa0cd93b1d287eefb0846093ed61e98dc (patch)
tree28c642813d9b70d7e9ad74a6818b9fc9990804fe /src
parent7143d9c7de17aa12bd6a6de2f857061dcc04f137 (diff)
#131 Dont assume that all entries have the mime_type property
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/journal/misc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index 581b2e2..a4e4240 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ -210,14 +210,15 @@ def resume(metadata, bundle_id=None):
activityfactory.create_with_object_id(bundle, object_id)
def is_activity_bundle(metadata):
- return metadata['mime_type'] == ActivityBundle.MIME_TYPE or \
- metadata['mime_type'] == ActivityBundle.DEPRECATED_MIME_TYPE
+ mime_type = metadata.get('mime_type', '')
+ return mime_type == ActivityBundle.MIME_TYPE or \
+ mime_type == ActivityBundle.DEPRECATED_MIME_TYPE
def is_content_bundle(metadata):
- return metadata['mime_type'] == ContentBundle.MIME_TYPE
+ return metadata.get('mime_type', '') == ContentBundle.MIME_TYPE
def is_journal_bundle(metadata):
- return metadata['mime_type'] == JournalEntryBundle.MIME_TYPE
+ return metadata.get('mime_type', '') == JournalEntryBundle.MIME_TYPE
def is_bundle(metadata):
return is_activity_bundle(metadata) or is_content_bundle(metadata) or \