Skip to content

Commit

Permalink
SamplePointLocations upgrade - should be on senaite.samplepointlocations
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunga001 committed Sep 21, 2024
1 parent 4e425f5 commit b0e24cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/senaite/core/upgrade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def permanently_allow_type_for(portal_type, allowed_type):
# get the current allowed types for the object
allowed_types = fti.allowed_content_types
# append the allowed type
fti.allowed_content_types = allowed_types + (allowed_type, )
fti.allowed_content_types = allowed_types + [allowed_type, ]


def set_uid(obj, uid):
Expand Down
5 changes: 5 additions & 0 deletions src/senaite/core/upgrade/v02_06_000.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,11 @@ def migrate_samplepoint_to_dx(src, destination=None):
# NOTE: always convert string values to unicode for dexterity fields!
target.title = api.safe_unicode(src.Title() or "")
target.description = api.safe_unicode(src.Description() or "")
target.sample_point_id = api.safe_unicode(src.SamplePointId or "")
target.sample_point_location = [src.aq_parent.UID()]
target.equipment_id = api.safe_unicode(src.EquipmentID or "")
target.equipment_type = api.safe_unicode(src.EquipmentType or "")
target.equipment_description = api.safe_unicode(src.EquipmentDescription or "")

# we set the fields with our custom setters
target.setLatitude(src.getLatitude())
Expand Down

0 comments on commit b0e24cd

Please sign in to comment.