Skip to content

Commit

Permalink
Merge pull request #1685 from UlrichB22/validate_meta
Browse files Browse the repository at this point in the history
maint-validate-metadata: skip userprofiles backend
  • Loading branch information
RogerHaase authored Apr 16, 2024
2 parents 474e9bb + 0fb9409 commit 930397e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/moin/cli/maint/modify_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
MoinMoin CLI - get an item revision from the wiki, put it back into the wiki.
"""

# see #1479, remove after dropping support for Python 3.8
from __future__ import annotations

from collections import defaultdict
from dataclasses import dataclass, field
import json
Expand All @@ -24,6 +21,7 @@
from moin.app import create_app, before_wiki
from moin.cli._util import get_backends
from moin.storage.middleware.serialization import get_rev_str, correcting_rev_iter
from moin.constants.namespaces import NAMESPACE_USERPROFILES
from moin.constants.keys import CURRENT, ITEMID, DATAID, NAMESPACE, WIKINAME, REVID, PARENTID, REV_NUMBER, MTIME, NAME
from moin.utils.interwiki import split_fqname
from moin.items import Item
Expand Down Expand Up @@ -275,6 +273,9 @@ def ValidateMetadata(backends=None, all_backends=False, verbose=False, fix=False
for issue in issues:
print(issue)
_fix_if_bad(bad, meta, data, bad_revids, fix, backend)
# Skipping checks for userprofiles, as revision numbers and parentids are not used here
if backend == app.cfg.backend_mapping[NAMESPACE_USERPROFILES]:
continue
# fix bad parentid references and repeated or missing revision numbers
for item_id, rev_datum in revs.items():
rev_datum.sort(key=lambda r: (r.rev_number, r.mtime))
Expand Down

0 comments on commit 930397e

Please sign in to comment.