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

Remove unnecessary external URL building for placeholder image #450

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

AetherUnbound
Copy link
Collaborator

Description of Changes

I did an audit of usages of url_for(..., _external=True) in the project. All other uses are for JSON+LD definition of breadcrumb elements which probably explicitly require the full URL with scheme:

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "OpenOversight",
"item": "{{ url_for('main.index', _external=True)|replace('/index','') }}"
}, {
"@type": "ListItem",
"position": 2,
"name": "{{ incident.department.name|title }} Incidents",
"item": "{{ url_for('main.incident_api', department_id=incident.department.id, _external=True) }}"
}, {
"@type": "ListItem",
"position": 3,
"name": "Incident{% if incident.report_number %} {{incident.report_number}}{% endif %}"
}]
}
</script>

All other cases were for email generation which also need the full URL with scheme.

Notes for Deployment

Screenshots (if appropriate)

Tests and linting

  • I have rebased my changes on main

  • just lint passes

  • just test passes

@AetherUnbound AetherUnbound requested a review from a team as a code owner May 25, 2024 22:39
@sea-kelp sea-kelp merged commit d796a55 into main Jun 2, 2024
2 checks passed
@sea-kelp sea-kelp deleted the feature/remove-unnecessary-external branch June 2, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants