fix: the video dialog marks the products that already have a published video (DTF-WEB-G, DTF-WEB-H)
All checks were successful
Build and deploy / Validate source (push) Successful in 11s
Build and deploy / Integration suite on a real stack (push) Successful in 7m20s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m40s

"Onde aparece" names the products another published video holds and
closes them while this one is published; turning Publicar on over a
taken product stays off and says which video holds it. The server checks
before copying any file and its refusal names that video too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-16 15:01:33 -03:00
parent 66bc2b9b03
commit 4cba424149
3 changed files with 37 additions and 8 deletions

View File

@@ -48,6 +48,13 @@ def run():
entry = next(row for row in published if row['id'] == 'sala')
assert entry['product'] == 'file'
assert entry['captions'] == '/api/site/videos/sala/captions'
# One floating video per product: a second one is refused before any
# copy, naming the video that holds the product (DTF-WEB-G).
refused = operator.call('/operator/site-videos/png', {'upload_id': video,
'product': 'file', 'enabled': True}, expected=409)
assert 'A sala às 3 da manhã' in refused['detail'], refused
with db.connect() as c:
assert not c.execute("SELECT 1 FROM dtf_local.site_videos WHERE id='png'").fetchone()
with urlopen(entry['src'], timeout=30) as response:
assert response.read() == VIDEO
with urlopen(Request(BASE + entry['captions'], headers=with_host()), timeout=30) as response: