diff options
Diffstat (limited to 'src/jarabe/journal/journalactivity.py')
-rw-r--r-- | src/jarabe/journal/journalactivity.py | 16 |
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) |