From 5ffdf0c05568cd1cc34f5f3e7f3f5abdffec05dd Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 27 Jan 2026 15:41:47 +0000 Subject: [PATCH] New year, new expo: bugs for auto-creating new expo --- core/forms.py | 24 ++++++++++++++++++++++-- core/views/signup.py | 1 + parsers/logbooks.py | 6 ++++-- parsers/people.py | 14 +++++++++----- templates/new_prospect.html | 1 - templates/troggletoolbar.html | 3 ++- 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/core/forms.py b/core/forms.py index 742e5bc..a9041ef 100644 --- a/core/forms.py +++ b/core/forms.py @@ -350,8 +350,8 @@ class NewProspectForm(forms.Form): max_length=20, widget=forms.TextInput(attrs={ "placeholder": "2025-AB-01", - "size": 10, - "style": "width: 10ch; min-width: 0;" + "size": 11, + "style": "width: 11ch; min-width: 0;" }) ) discovery_name = forms.CharField( @@ -394,6 +394,26 @@ class NewProspectForm(forms.Form): "style": "width: 20ch; min-width: 0;" }) ) + entrance_description = forms.CharField( + label="Entrance description", + max_length=100, + required=True, + widget=forms.TextInput(attrs={ + "placeholder": "horizontal slot at foot level in 3m high NE-facing cliff", + "size": 100, + "style": "width: 100ch; min-width: 0;" + }) + ) + approach = forms.CharField( + label="Approach", + max_length=100, + required=True, + widget=forms.TextInput(attrs={ + "placeholder": "from top camp, go NE round the side of Augst Eck, in some trees", + "size": 100, + "style": "width: 100ch; min-width: 0;" + }) + ) who_are_you = forms.CharField( label="Who are you", max_length=100, diff --git a/core/views/signup.py b/core/views/signup.py index 4f5365a..27a0cce 100644 --- a/core/views/signup.py +++ b/core/views/signup.py @@ -140,6 +140,7 @@ def read_signups(): signupsfile = signups_dir / SIGNUPS_FILE if not signupsfile.is_file(): + print(f" ! Nobody has signed up for expedition {current_expo()} yet.") return { "SIGNEDUP": {} } # dict where e.g. {"philip-sargent": encrypted_form_data, more users etc.} with open(signupsfile, 'r', encoding='utf-8') as json_f: diff --git a/parsers/logbooks.py b/parsers/logbooks.py index ba98db7..a4207dc 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -828,12 +828,14 @@ def _collect_logbook_entries_for_expos(expos, nologbook, ENTRIES, BLOG_PARSER_SE for ex in loglist: logentries = parse_logbook_for_expedition(ex) - allentries += logentries + if logentries: + allentries += logentries for b in bloglist: print(f" - BLOG: {b}") logentries = parse_logbook_for_expedition(b, blog=True) - allentries += logentries + if logentries: + allentries += logentries return allentries diff --git a/parsers/people.py b/parsers/people.py index 40a8646..fc739fe 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -241,13 +241,17 @@ def load_people_expos(): def check_new_signups(expedition): signups_clear = read_signups() - # print(signups_clear) + print(signups_clear) + if 'SIGNEDUP' in signups_clear: + return for slug in signups_clear: print(f" - Checking signups {slug}") - p = Person.objects.get(slug=slug) - pe = PersonExpedition.objects.update_or_create(person=p, expedition=expedition) - # print("ADDING ",pe, expedition) - + try: + p = Person.objects.get(slug=slug) + pe = PersonExpedition.objects.update_or_create(person=p, expedition=expedition) + # print("ADDING ",pe, expedition) + except Exception as e: + print("EXCEPTION ADDING ",slug , expedition) def ensure_users_are_persons(): # Just ensure this is up to date. diff --git a/templates/new_prospect.html b/templates/new_prospect.html index 126f52e..87b54b1 100644 --- a/templates/new_prospect.html +++ b/templates/new_prospect.html @@ -25,7 +25,6 @@ New Cave and Entrance } .prospect-form label { display: inline-block; - width: 320px; text-align: right; margin-right: 20px; margin-bottom: 8px; diff --git a/templates/troggletoolbar.html b/templates/troggletoolbar.html index 0a9427b..4194933 100644 --- a/templates/troggletoolbar.html +++ b/templates/troggletoolbar.html @@ -24,8 +24,9 @@ {% endif %} Logbook Entry | Caves | + New Prospect | QMs | - Survex files | + Survex | Scans | Upload Scans | Drawings |