mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Update displayOrder for line properties #2224

Closed collinpreston closed 1 month ago

collinpreston commented 1 month ago

What are the relevant tickets?

Fixes the error below which was received when running ./manage.py configure_hubspot_properties in Production.

HTTP response body: {"status":"error","message":"Property option display orders must be unique. For the property 'status' of object type '0-8' in portal 20596155 these options are duplicated: The labels fulfilled, pending have display order 0. The labels canceled, declined, errored, partially_refunded, refunded, review have display order 1. ","correlationId":"551b3340-e9b6-4174-8d9c-47bc4608a477","context":{"portalId":["20596155"],"property":["status"],"objectTypeId":["0-8"],"duplicates":["The labels fulfilled, pending have display order 0. The labels canceled, declined, errored, partially_refunded, refunded, review have display order 1. "]},"category":"VALIDATION_ERROR","subCategory":"PropertyValidationError.DUPLICATE_OPTION_DISPLAY_ORDER"}

Description (What does it do?)

Updates the displayOrder variable for items in the Line property that is used when configuring custom Hubspot properties with the configure_hubspot_properties command.

How can this be tested?

This command ran successfully when testing against the mitx-online dev environment within Hubspot, but failed when running the command in Production. The the changes this PR makes are pretty logical when considering the error message provided.