fix: update theatre laboratory details

This commit is contained in:
bisco
2026-06-22 19:56:10 +02:00
parent cff9a17c3c
commit 8155d94fee
8 changed files with 68 additions and 32 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ Edit this file for each repository.
## Project identity ## Project identity
Project name: `Laboratorio Teatrale` Project name: `Azione!Lab`
Project description: `Headless Wagtail CMS and Astro single-page website for a theatre workshop.` Project description: `Headless Wagtail CMS and Astro single-page website for a theatre workshop.`
Primary language/runtime: `Python 3.12 and Node.js 22` Primary language/runtime: `Python 3.12 and Node.js 22`
+1 -1
View File
@@ -1,4 +1,4 @@
# Laboratorio Teatrale # Azione!Lab
A warm, editorial single-page website for a contemporary theatre workshop. Wagtail A warm, editorial single-page website for a contemporary theatre workshop. Wagtail
provides an editor-friendly headless CMS, Astro renders the public site, PostgreSQL provides an editor-friendly headless CMS, Astro renders the public site, PostgreSQL
+1 -1
View File
@@ -113,7 +113,7 @@ MEDIA_ROOT = BASE_DIR / "media"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
WAGTAIL_SITE_NAME = "Laboratorio Teatrale" WAGTAIL_SITE_NAME = "Azione!Lab"
WAGTAILADMIN_BASE_URL = os.getenv("WAGTAILADMIN_BASE_URL", "http://localhost:8000") WAGTAILADMIN_BASE_URL = os.getenv("WAGTAILADMIN_BASE_URL", "http://localhost:8000")
WAGTAIL_I18N_ENABLED = False WAGTAIL_I18N_ENABLED = False
+21 -17
View File
@@ -106,46 +106,50 @@ class Command(BaseCommand):
site = Site.objects.create( site = Site.objects.create(
hostname="localhost", hostname="localhost",
port=8000, port=8000,
site_name="Laboratorio Teatrale", site_name="Azione!Lab",
root_page=homepage, root_page=homepage,
is_default_site=True, is_default_site=True,
) )
elif site.root_page_id != homepage.id: else:
update_fields = []
if site.root_page_id != homepage.id:
site.root_page = homepage site.root_page = homepage
site.site_name = "Laboratorio Teatrale" update_fields.append("root_page")
site.save(update_fields=["root_page", "site_name"]) if site.site_name != "Azione!Lab":
site.site_name = "Azione!Lab"
update_fields.append("site_name")
if update_fields:
site.save(update_fields=update_fields)
settings, _ = SiteSettings.objects.get_or_create(site=site) settings, _ = SiteSettings.objects.get_or_create(site=site)
settings.laboratory_name = "Laboratorio Teatrale" settings.laboratory_name = "Azione!Lab"
settings.short_claim = "Il teatro diventa presenza." settings.short_claim = "Il teatro diventa presenza."
settings.email = "ciao@laboratorioteatrale.it" settings.email = "ciao@laboratorioteatrale.it"
settings.phone = "+39 333 123 4567" settings.phone = "+39 333 123 4567"
settings.whatsapp = "+39 333 123 4567" settings.whatsapp = "+39 333 123 4567"
settings.instagram = "https://www.instagram.com/" settings.instagram = "https://www.instagram.com/"
settings.facebook = "https://www.facebook.com/" settings.facebook = "https://www.facebook.com/"
settings.address = "Via del Teatro 12, Roma" settings.address = "Via dell'Epomeo 9999, Napoli"
settings.footer_text = "Uno spazio di ricerca, ascolto e presenza." settings.footer_text = "Uno spazio di ricerca, ascolto e presenza."
settings.save() settings.save()
TeacherProfile.objects.update_or_create( teacher = TeacherProfile.objects.order_by("id").first() or TeacherProfile()
name="Andrea Rossi", teacher.name = "Ernesto Estatico"
defaults={ teacher.photo = teacher_image
"photo": teacher_image, teacher.short_bio = (
"short_bio": (
"Attore, regista e formatore. Accompagna gruppi e persone " "Attore, regista e formatore. Accompagna gruppi e persone "
"nella ricerca di una presenza scenica sincera." "nella ricerca di una presenza scenica sincera."
), )
"full_bio": ( teacher.full_bio = (
"<p>Da oltre quindici anni lavora tra formazione, creazione " "<p>Da oltre quindici anni lavora tra formazione, creazione "
"collettiva e spettacolo dal vivo.</p>" "collettiva e spettacolo dal vivo.</p>"
),
"quote": "Il teatro non è fingere: è imparare a essere presenti.",
},
) )
teacher.quote = "Il teatro non è fingere: è imparare a essere presenti."
teacher.save()
LessonInfo.objects.update_or_create( LessonInfo.objects.update_or_create(
day_time="Ogni mercoledì, 19:3022:00", day_time="Ogni mercoledì, 19:3022:00",
defaults={ defaults={
"location": "Spazio Teatro, Via del Teatro 12, Roma", "location": "Spazio Teatro, Via dell'Epomeo 9999, Napoli",
"audience": "Adulti, con o senza esperienza precedente.", "audience": "Adulti, con o senza esperienza precedente.",
"description": ( "description": (
"<p>Training fisico e vocale, improvvisazione, ascolto, " "<p>Training fisico e vocale, improvvisazione, ascolto, "
@@ -0,0 +1,15 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("home", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="sitesettings",
name="laboratory_name",
field=models.CharField(default="Azione!Lab", max_length=120),
),
]
+1 -1
View File
@@ -9,7 +9,7 @@ from wagtail.snippets.models import register_snippet
@register_setting(icon="cog") @register_setting(icon="cog")
class SiteSettings(BaseSiteSetting): class SiteSettings(BaseSiteSetting):
laboratory_name = models.CharField(max_length=120, default="Laboratorio Teatrale") laboratory_name = models.CharField(max_length=120, default="Azione!Lab")
short_claim = models.CharField(max_length=180, blank=True) short_claim = models.CharField(max_length=180, blank=True)
email = models.EmailField(blank=True) email = models.EmailField(blank=True)
phone = models.CharField(max_length=40, blank=True) phone = models.CharField(max_length=40, blank=True)
+18 -1
View File
@@ -3,7 +3,7 @@ import tempfile
from django.core.management import call_command from django.core.management import call_command
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
from home.models import GalleryItem, HomePage, Show from home.models import GalleryItem, HomePage, Show, TeacherProfile
@override_settings(WAGTAILADMIN_BASE_URL="https://cms.example.test") @override_settings(WAGTAILADMIN_BASE_URL="https://cms.example.test")
@@ -36,6 +36,13 @@ class HomeApiTests(TestCase):
}, },
) )
self.assertEqual(payload["homepage"]["hero_title"], "Il teatro diventa presenza.") self.assertEqual(payload["homepage"]["hero_title"], "Il teatro diventa presenza.")
self.assertEqual(payload["settings"]["laboratory_name"], "Azione!Lab")
self.assertEqual(payload["settings"]["address"], "Via dell'Epomeo 9999, Napoli")
self.assertEqual(payload["teacher"]["name"], "Ernesto Estatico")
self.assertEqual(
payload["lesson_info"]["location"],
"Spazio Teatro, Via dell'Epomeo 9999, Napoli",
)
self.assertEqual(len(payload["feature_cards"]), 3) self.assertEqual(len(payload["feature_cards"]), 3)
self.assertTrue( self.assertTrue(
payload["homepage"]["hero_image"]["url"].startswith( payload["homepage"]["hero_image"]["url"].startswith(
@@ -61,6 +68,16 @@ class HomeApiTests(TestCase):
self.assertEqual(Show.objects.count(), 2) self.assertEqual(Show.objects.count(), 2)
self.assertEqual(GalleryItem.objects.count(), 4) self.assertEqual(GalleryItem.objects.count(), 4)
def test_seed_updates_the_existing_teacher_without_creating_a_duplicate(self):
teacher = TeacherProfile.objects.get()
teacher.name = "Andrea Rossi"
teacher.save(update_fields=["name"])
call_command("seed_demo", verbosity=0)
self.assertEqual(TeacherProfile.objects.count(), 1)
self.assertEqual(TeacherProfile.objects.get().name, "Ernesto Estatico")
class HealthTests(TestCase): class HealthTests(TestCase):
def test_health_endpoint_checks_database(self): def test_health_endpoint_checks_database(self):
+5 -5
View File
@@ -88,14 +88,14 @@ const placeholder = (name: string, alt: string): CmsImage => ({
export const fallbackHomeData: HomeData = { export const fallbackHomeData: HomeData = {
settings: { settings: {
site_name: "Laboratorio Teatrale", site_name: "Azione!Lab",
short_claim: "Il teatro diventa presenza.", short_claim: "Il teatro diventa presenza.",
email: "ciao@laboratorioteatrale.it", email: "ciao@laboratorioteatrale.it",
phone: "+39 333 123 4567", phone: "+39 333 123 4567",
whatsapp: "+39 333 123 4567", whatsapp: "+39 333 123 4567",
instagram: "https://instagram.com/", instagram: "https://instagram.com/",
facebook: "https://facebook.com/", facebook: "https://facebook.com/",
address: "Via della Scena 12, Roma", address: "Via dell'Epomeo 9999, Napoli",
footer_text: "Uno spazio aperto a chi desidera incontrare il teatro, insieme.", footer_text: "Uno spazio aperto a chi desidera incontrare il teatro, insieme.",
}, },
homepage: { homepage: {
@@ -132,8 +132,8 @@ export const fallbackHomeData: HomeData = {
}, },
], ],
teacher: { teacher: {
name: "Andrea Morelli", name: "Ernesto Estatico",
photo: placeholder("teacher", "Ritratto del maestro Andrea Morelli"), photo: placeholder("teacher", "Ritratto del maestro Ernesto Estatico"),
short_bio: short_bio:
"Attore, regista e formatore, accompagna gruppi di ogni esperienza con cura e concretezza.", "Attore, regista e formatore, accompagna gruppi di ogni esperienza con cura e concretezza.",
full_bio: full_bio:
@@ -142,7 +142,7 @@ export const fallbackHomeData: HomeData = {
}, },
lesson_info: { lesson_info: {
schedule: "Ogni martedì, dalle 20:00 alle 22:30", schedule: "Ogni martedì, dalle 20:00 alle 22:30",
location: "Spazio Scena, Via della Scena 12, Roma", location: "Spazio Teatro, Via dell'Epomeo 9999, Napoli",
audience: "Adulti, con o senza esperienza", audience: "Adulti, con o senza esperienza",
description: "Training fisico e vocale, improvvisazione, ascolto, costruzione del personaggio e lavoro di scena.", description: "Training fisico e vocale, improvvisazione, ascolto, costruzione del personaggio e lavoro di scena.",
trial_lesson: "La prima lezione di prova è gratuita, su prenotazione.", trial_lesson: "La prima lezione di prova è gratuita, su prenotazione.",