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

Validate topics in the clean method #6240

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

akatsoulas
Copy link
Collaborator

No description provided.

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @akatsoulas ! I should have done this as part of #6186.

In addition to the comments below -- which when addressed resolve at least one of the unit test failures -- I think one or two of the other unit test failures still need to be addressed as well.

kitsune/wiki/forms.py Outdated Show resolved Hide resolved
kitsune/wiki/forms.py Outdated Show resolved Hide resolved
kitsune/wiki/forms.py Outdated Show resolved Hide resolved
@akatsoulas akatsoulas force-pushed the kb-topic-form branch 2 times, most recently from ff0538f to b1a9558 Compare September 24, 2024 12:36
Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @akatsoulas!

raise forms.ValidationError(TOPIC_REQUIRED)

return c
associated_topics = Topic.active.filter(products__in=products).distinct()
invalid_topics = topics.difference(associated_topics)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Nice! I've overlooked this feature, so thanks for enlightening me!

@akatsoulas akatsoulas merged commit dae212b into mozilla:main Sep 24, 2024
2 checks passed
@akatsoulas akatsoulas deleted the kb-topic-form branch September 24, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants