Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PNI] - Subcategories - harden the subcategory form/save logic #7644

Closed
Pomax opened this issue Oct 19, 2021 · 6 comments · Fixed by #7997
Closed

[PNI] - Subcategories - harden the subcategory form/save logic #7644

Pomax opened this issue Oct 19, 2021 · 6 comments · Fixed by #7997
Assignees
Labels
backend buyer's guide 🛍 Issues related to the buyer's guide code cleanup engineering wagtail wagtail related issues
Milestone

Comments

@Pomax
Copy link
Contributor

Pomax commented Oct 19, 2021

The initial subcategory code from #7641 allows for some things we may want to "lock down";

  • categories can be nested infinitely deep
  • categories can technically be linked up into a cycle

Let's harden that code a little so that at the very least that last option isn't possible anymore, and then possibly lock down the first option, too.

From @richbrennan:

In case it might be useful, I've been meaning to investigate this for nested categories: https://posts-by.lb.ee/building-a-configurable-taxonomy-in-wagtail-django-94ca1080fb28

@Pomax Pomax added engineering wagtail wagtail related issues backend labels Oct 19, 2021
@Pomax Pomax added this to the PNI Q3 2021 milestone Oct 19, 2021
@Pomax Pomax added the stretch label Oct 27, 2021
@benhohner benhohner added code cleanup buyer's guide 🛍 Issues related to the buyer's guide labels Nov 8, 2021
@richbrennan
Copy link
Contributor

@jamilasnell @Pomax

One I might be able to pick up?

@Pomax
Copy link
Contributor Author

Pomax commented Nov 25, 2021

absolutely - this also combines well with the issue for not allowing categories to be saved if there is already a category with the same name.

@Pomax
Copy link
Contributor Author

Pomax commented Nov 25, 2021

estimating this as a 4 (dev + review time) but feel free to adjust up or down.

@richbrennan
Copy link
Contributor

Had planned to look at this today but have been assigned to MozFest work

@richbrennan
Copy link
Contributor

@Pomax

categories can be nested infinitely deep

What would be a suitable limit to how deeply they can be nested?

@Pomax
Copy link
Contributor Author

Pomax commented Dec 15, 2021

For now, given that we're only using single-parent, let's just go with one level deep and then if we need deeper in the future and everyone's signed off on that need, we can update this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend buyer's guide 🛍 Issues related to the buyer's guide code cleanup engineering wagtail wagtail related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants