Two bugs, both mine. The profile page arrived unstyled because its CSS was in a <style> block. default-src 'self' covers style-src, 'self' does not permit inline, so the browser dropped the whole block without a word — the photo loaded because img-src allows same-origin, which is what made the screenshot look like a half-working page rather than a blocked one. The third time this policy has silently made something inert, after two rounds of inline event handlers. Moved to static/profile.css, where the policy allows it, and test_templates.py now fails on an inline <style> the way it already does on an inline onclick. Private messages had an "Abrir conversación" button that created an empty conversation and sent you to a page where you then had to type. It bought nothing and littered the inbox with rows reading "Sin mensajes todavía" for people nobody had written to. A conversation is now addressed by the person — /privados/con/<member_id> — and the page always carries the history and the box together. The row is created by the first message, not by looking at somebody's name. That also makes the access rule structural instead of checked. Every lookup is scoped to the member doing the looking, so there is no query that could return somebody else's correspondence, and the two helpers that took a conversation id are gone. A third person opening the same URL now sees their own empty conversation, which the tests assert directly rather than asserting a 404. 281 tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
43 lines
1.5 KiB
HTML
43 lines
1.5 KiB
HTML
{# A page on the PUBLIC site, so it does not extend base.html — that is the
|
|
members-area chrome, with its navigation and its "Área privada" footer.
|
|
|
|
Its styling lives in static/profile.css and NOT in a <style> block here.
|
|
The Content-Security-Policy has no 'unsafe-inline', so an inline block is
|
|
ignored by the browser without a word, and the page arrives looking like
|
|
1996. test_templates.py fails the build if one reappears. #}
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{ member.display_name }} — Viena Latina</title>
|
|
<meta name="description" content="{{ (member.bio or '')[:150] }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='profile.css') }}">
|
|
</head>
|
|
<body>
|
|
<div class="wrap">
|
|
<a class="home" href="/">← Viena Latina</a>
|
|
|
|
<div class="head">
|
|
{% if photo %}<img class="photo" src="{{ photo }}" alt="{{ member.display_name }}">{% endif %}
|
|
<h1>{{ member.display_name }}</h1>
|
|
</div>
|
|
|
|
{% if member.bio %}<div class="bio">{{ bio_html }}</div>{% endif %}
|
|
|
|
{% if links %}
|
|
<ul class="links">
|
|
{# nofollow + noopener: these are addresses somebody typed into a form,
|
|
and the page they point at should gain neither our ranking nor a
|
|
handle on the window it was opened from. #}
|
|
{% for link in links %}
|
|
<li><a href="{{ link.url }}" rel="nofollow noopener">{{ link.label }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
<footer>Miembro de <a href="/">Viena Latina</a>.</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|