Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/journal/journalactivity.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2009-11-26 15:45:27 (GMT)
committer Daniel Drake <dsd@laptop.org>2009-11-26 15:45:27 (GMT)
commitd83d3fce34c86a617cb6524e00c3383cece15222 (patch)
tree7a3c4e969672458253de0fa7f3499a2921aee28f /src/jarabe/journal/journalactivity.py
parentbd3fdd73a853d618aa5000ff5b1ce82f196c8b70 (diff)
Journal entry bundles shouldn't create a 2nd ds entry
This fixes a problem where "Show in Journal" from a Browse download was broken. This is because the JEB installation code would extract the content from the bundle entry, install it as a new datastore entry, and then delete the bundle entry. This is fixed by making the journal entry from the bundle take over the datastore entry that belonged to the bundle.
Diffstat (limited to 'src/jarabe/journal/journalactivity.py')
-rw-r--r--src/jarabe/journal/journalactivity.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index 0d6d09d..0559560 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -276,16 +276,24 @@ class JournalActivity(Window):
if registry.is_installed(bundle):
logging.debug('_check_for_bundle bundle already installed')
return
+
+ if metadata['mime_type'] == JournalEntryBundle.MIME_TYPE:
+ # JournalEntryBundle code takes over the datastore entry and
+ # transforms it into the journal entry from the bundle -- we have
+ # nothing more to do.
+ try:
+ registry.install(bundle, metadata['uid'])
+ except (ZipExtractException, RegistrationException):
+ logging.exception('Could not install bundle %s',
+ bundle.get_path())
+ return
+
try:
registry.install(bundle)
except (ZipExtractException, RegistrationException):
logging.exception('Could not install bundle %s', bundle.get_path())
return
- if metadata['mime_type'] == JournalEntryBundle.MIME_TYPE:
- model.delete(object_id)
- return
-
metadata['bundle_id'] = bundle.get_bundle_id()
model.write(metadata)