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

fix(authorities): clarify number of references in docket authorities #4968

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

elisa-a-v
Copy link
Contributor

Fixes #4865

Before this PR
After this PR

WIP:

  • get rid of repeated DB queries.
  • fix title that says "The filings in this docket cite X opinions"

Similar to the authorities property, but instead of an
OpinionsCitedByRECAPDocuments, it returns an Opinion queryset.
We were listing OpinionsCitedByRECAPDocuments instead of Opinions,
so the list of authorities shown repeated the same Opinion several
times if multiple documents in the same docket cited it.

We now list Opinions instead, and the template is more descriptive.
</a>
make {{ opinion.total_depth }} references to
<a href="{{ opinion.cluster.get_absolute_url }}{% querystring %}" {% if opinion.cluster.blocked %}rel="nofollow" {% endif %}>
{{ opinion.cluster.caption|safe|v_wrapper }}
Copy link

Choose a reason for hiding this comment

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

Semgrep identified an issue in your code:

Detected a segment of a Flask template where autoescaping is explicitly disabled with '| safe' filter. This allows rendering of raw HTML in this segment. Ensure no user data is rendered here, otherwise this is a cross-site scripting (XSS) vulnerability.

To resolve this comment:

🔧 No guidance has been designated for this issue. Fix according to your organization's approved methods.

💬 Ignore this finding

Leave a nosemgrep comment directly above or at the end of line 11 like so // nosemgrep: python.flask.security.xss.audit.template-unescaped-with-safe.template-unescaped-with-safe

Take care to validate that this is not a true positive finding before ignoring it.
Learn more about ignoring code, files and folders here.

You can view more details about this finding in the Semgrep AppSec Platform.

@mlissner
Copy link
Member

Looks good!

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

Successfully merging this pull request may close these issues.

Clarify number of references on Authorities Page vs. Search Results
3 participants