mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 05:58:45 +00:00
New year, new expo: bugs for auto-creating new expo
This commit is contained in:
@@ -350,8 +350,8 @@ class NewProspectForm(forms.Form):
|
|||||||
max_length=20,
|
max_length=20,
|
||||||
widget=forms.TextInput(attrs={
|
widget=forms.TextInput(attrs={
|
||||||
"placeholder": "2025-AB-01",
|
"placeholder": "2025-AB-01",
|
||||||
"size": 10,
|
"size": 11,
|
||||||
"style": "width: 10ch; min-width: 0;"
|
"style": "width: 11ch; min-width: 0;"
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
discovery_name = forms.CharField(
|
discovery_name = forms.CharField(
|
||||||
@@ -394,6 +394,26 @@ class NewProspectForm(forms.Form):
|
|||||||
"style": "width: 20ch; min-width: 0;"
|
"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(
|
who_are_you = forms.CharField(
|
||||||
label="Who are you",
|
label="Who are you",
|
||||||
max_length=100,
|
max_length=100,
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ def read_signups():
|
|||||||
|
|
||||||
signupsfile = signups_dir / SIGNUPS_FILE
|
signupsfile = signups_dir / SIGNUPS_FILE
|
||||||
if not signupsfile.is_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.}
|
return { "SIGNEDUP": {} } # dict where e.g. {"philip-sargent": encrypted_form_data, more users etc.}
|
||||||
|
|
||||||
with open(signupsfile, 'r', encoding='utf-8') as json_f:
|
with open(signupsfile, 'r', encoding='utf-8') as json_f:
|
||||||
|
|||||||
@@ -828,12 +828,14 @@ def _collect_logbook_entries_for_expos(expos, nologbook, ENTRIES, BLOG_PARSER_SE
|
|||||||
|
|
||||||
for ex in loglist:
|
for ex in loglist:
|
||||||
logentries = parse_logbook_for_expedition(ex)
|
logentries = parse_logbook_for_expedition(ex)
|
||||||
allentries += logentries
|
if logentries:
|
||||||
|
allentries += logentries
|
||||||
|
|
||||||
for b in bloglist:
|
for b in bloglist:
|
||||||
print(f" - BLOG: {b}")
|
print(f" - BLOG: {b}")
|
||||||
logentries = parse_logbook_for_expedition(b, blog=True)
|
logentries = parse_logbook_for_expedition(b, blog=True)
|
||||||
allentries += logentries
|
if logentries:
|
||||||
|
allentries += logentries
|
||||||
|
|
||||||
return allentries
|
return allentries
|
||||||
|
|
||||||
|
|||||||
@@ -241,13 +241,17 @@ def load_people_expos():
|
|||||||
|
|
||||||
def check_new_signups(expedition):
|
def check_new_signups(expedition):
|
||||||
signups_clear = read_signups()
|
signups_clear = read_signups()
|
||||||
# print(signups_clear)
|
print(signups_clear)
|
||||||
|
if 'SIGNEDUP' in signups_clear:
|
||||||
|
return
|
||||||
for slug in signups_clear:
|
for slug in signups_clear:
|
||||||
print(f" - Checking signups {slug}")
|
print(f" - Checking signups {slug}")
|
||||||
p = Person.objects.get(slug=slug)
|
try:
|
||||||
pe = PersonExpedition.objects.update_or_create(person=p, expedition=expedition)
|
p = Person.objects.get(slug=slug)
|
||||||
# print("ADDING ",pe, expedition)
|
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():
|
def ensure_users_are_persons():
|
||||||
# Just ensure this is up to date.
|
# Just ensure this is up to date.
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ New Cave and Entrance
|
|||||||
}
|
}
|
||||||
.prospect-form label {
|
.prospect-form label {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 320px;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
|
|||||||
@@ -24,8 +24,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/logbookedit/">Logbook Entry</a> |
|
<a href="/logbookedit/">Logbook Entry</a> |
|
||||||
<a id="cavesLink" href="/caves_recent">Caves</a> |
|
<a id="cavesLink" href="/caves_recent">Caves</a> |
|
||||||
|
<a id="prospectLink" href="/newprospect">New Prospect</a> |
|
||||||
<a id="qmsLink" href="{% url "caveQMs" "1623-290" %}">QMs</a> |
|
<a id="qmsLink" href="{% url "caveQMs" "1623-290" %}">QMs</a> |
|
||||||
<a href="{% url "survexcaveslist" %}">Survex files</a> |
|
<a href="{% url "survexcaveslist" %}">Survex</a> |
|
||||||
<a href="{% url "allscans" %}">Scans</a> |
|
<a href="{% url "allscans" %}">Scans</a> |
|
||||||
<a href="{% url "walletedit" %}">Upload Scans</a> |
|
<a href="{% url "walletedit" %}">Upload Scans</a> |
|
||||||
<a href="{% url "dwgallfiles" %}">Drawings</a> |
|
<a href="{% url "dwgallfiles" %}">Drawings</a> |
|
||||||
|
|||||||
Reference in New Issue
Block a user