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

Make safety layer tags red #707

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Make safety layer tags red #707

wants to merge 2 commits into from

Conversation

SmittieC
Copy link
Collaborator

@SmittieC SmittieC commented Oct 4, 2024

Description

Red safety layer violation tags

User Impact

N/A

Demo

this one

Docs

N/A

@SmittieC SmittieC requested a review from snopoke October 4, 2024 11:25
@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/annotations/models.py 0.00% 2 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

for tag in self.tags.all():
bage_color = "badge-neutral"
if tag.is_system_tag:
bage_color = "badge-error" if tag.category == TagCategories.SAFETY_LAYER_RESPONSE else "badge-warning"
Copy link
Collaborator

Choose a reason for hiding this comment

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

It can be dangerous to use css classes in Python since the post processor will remove classes that aren't used and it doesn't currently check python files for usages.

What about doing this logic in the template and just using 'tags_json' instead of this method? I think we could get rid of this method entirely if we did that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants