Skip to content

Commit 0b83d17

Browse files
committed
prevent promotion from copying id's over to curatedurls
1 parent 178b5bc commit 0b83d17

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sde_collections/models/collection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def promote_to_curated(self):
207207
updated_fields = {}
208208
for field in delta._meta.fields:
209209
field_name = field.name
210-
if field_name == "to_delete":
210+
if field_name in ["to_delete", "id"]:
211211
continue
212212

213213
delta_value = getattr(delta, field_name)
@@ -221,7 +221,8 @@ def promote_to_curated(self):
221221
new_data = {
222222
field.name: getattr(delta, field.name)
223223
for field in delta._meta.fields
224-
if field.name not in ["to_delete", "collection"] and getattr(delta, field.name) not in [None, ""]
224+
if field.name not in ["to_delete", "collection", "id"]
225+
and getattr(delta, field.name) not in [None, ""]
225226
}
226227
CuratedUrl.objects.create(collection=self, **new_data)
227228

0 commit comments

Comments
 (0)