Add product version to question cards for contributors#7553
Open
denyshon wants to merge 1 commit into
Open
Conversation
akatsoulas
reviewed
Jun 15, 2026
| tags.append(f"{product_name} {version}") | ||
| if tenths and tenths != version: | ||
| tags.append(f"{product_name} {tenths}") | ||
| self.add_metadata(sanitized_product_version=sanitized_product_version) |
Collaborator
There was a problem hiding this comment.
This will be called on every update of the question. The add_metadata will call basically the QuestionMetaData.objects.create(...) but he model has a unique constraint applied. I suspect this is is going to lead to an IntegrityError from the DB.
| </svg> | ||
| {{ question.product.title }} | ||
| </a> | ||
| {% if user_is_contributor %} |
Collaborator
There was a problem hiding this comment.
I wonder if we can push the logic with the nested if statements into python in a @property like display_version to simplify the template to something like
{% if user_is_contributor and question.display_version %}
{{ question.display_version }}
{% endif %}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #2958.
To avoid fetching tags, we can use question metadata to get product versions (and display them). However, if we use raw data from the corresponding fields, this would expose us to all kinds of spam and UI breakages related to user input. In order to prevent that, this patch saves our validated version number (used to apply tags) into a separate question metadata field, and then displays it on question cards. For older questions, we fall back to the raw data from the version fields.
The SCSS changes do not represent any visual change, and are purely for clarity/future.