2020-10-17 14:51:38 -05:00
|
|
|
def set_custom_fields_values(entity, custom_field_data):
|
2021-02-08 04:59:33 -06:00
|
|
|
if not custom_field_data:
|
|
|
|
return
|
|
|
|
|
|
|
|
entity.custom_field_data = custom_field_data
|
|
|
|
return entity.save()
|
2020-10-17 14:51:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
def pop_custom_fields(params):
|
2021-02-08 04:59:33 -06:00
|
|
|
if "custom_field_data" in params:
|
|
|
|
return params.pop("custom_field_data")
|
|
|
|
elif "custom_fields" in params:
|
|
|
|
print("⚠️ Please rename 'custom_fields' to 'custom_field_data'!")
|
|
|
|
return params.pop("custom_fields")
|
2020-10-17 14:51:38 -05:00
|
|
|
|
2021-02-08 04:59:33 -06:00
|
|
|
return None
|