Skip to content

Commit

Permalink
We need to specify the path depth and numchild because name, descript…
Browse files Browse the repository at this point in the history
…ion and slug should be updated afterwards
  • Loading branch information
viggo-devries committed Sep 26, 2024
1 parent b1a5c7f commit a63e338
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oscarapi/utils/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _upsert_categories(data, parent_category=None):
category.move(parent_category, pos="first-child")

# Update the category to make it aware of it's new home after moving
category.refresh_from_db()
category.refresh_from_db(fields=["path", "depth", "numchild"])

# The category is now the sibling, new categories will be moved to the right of this category
sibling = category
Expand Down

0 comments on commit a63e338

Please sign in to comment.