Skip to content

Commit

Permalink
fixes migration with empty migration mark (closes #27)
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim committed Dec 13, 2024
1 parent 993e6f1 commit 027db24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
maintainers = [
{name = "Tim Holzheim", email = "[email protected]"},
]
version = "0.0.14"
version = "0.0.15"
readme = "README.md"
license= "Apache-2.0"
dependencies = [
Expand Down
5 changes: 3 additions & 2 deletions src/wikibasemigrator/migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,11 @@ def add_migration_mark_to_entity(
:param migration_mark:
:return:
"""
if migration_mark is None:
if migration_mark is None or migration_mark:
return
claim = migration_mark.get_claim()
EntityMerger().merge_statement(claim, translation.entity)
if claim is not None:
EntityMerger().merge_statement(claim, translation.entity)

@staticmethod
def _migrate_entity(
Expand Down
2 changes: 1 addition & 1 deletion src/wikibasemigrator/model/migration_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_claim(self) -> datatypes.BaseDataType | None:
Get the migration mark as claim
:return:
"""
if self.value is None:
if self.value is None or self.value == "":
return None
claim = None
match self.property_type:
Expand Down

0 comments on commit 027db24

Please sign in to comment.