Skip to content

Commit

Permalink
import19: add namespace for attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichB22 committed Sep 2, 2024
1 parent 8be78f7 commit 83a8c19
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/moin/cli/migration/moin19/import19.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ def iter_attachments(self):
attachname = fname
try:
yield AttachmentRevision(
self.name, attachname, os.path.join(attachmentspath, fname), self.editlog, self.acl
self.name,
attachname,
os.path.join(attachmentspath, fname),
self.editlog,
self.acl,
self.target_namespace,
)
except Exception:
logging.exception(f"AttachmentRevision {self.name!r}/{attachname!r} raised exception:")
Expand Down Expand Up @@ -641,7 +646,7 @@ class AttachmentRevision:
moin 1.9 attachment (there is no revisioning, just 1 revision per attachment)
"""

def __init__(self, item_name, attach_name, attpath, editlog, acl):
def __init__(self, item_name, attach_name, attpath, editlog, acl, namespace):
try:
meta = editlog.find_attach(attach_name)
except KeyError:
Expand All @@ -659,6 +664,7 @@ def __init__(self, item_name, attach_name, attpath, editlog, acl):
meta[hash_name] = hash_digest
meta[SIZE] = size
meta[ITEMID] = make_uuid()
meta[NAMESPACE] = namespace
meta[REVID] = make_uuid()
meta[REV_NUMBER] = 1
meta[ITEMTYPE] = ITEMTYPE_DEFAULT
Expand Down

0 comments on commit 83a8c19

Please sign in to comment.