mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 19:47:12 +00:00
validate year in logbook entry form
This commit is contained in:
@@ -8,6 +8,8 @@ import subprocess
|
||||
from decimal import getcontext
|
||||
from pathlib import Path
|
||||
|
||||
from troggle.core.models.troggle import Expedition
|
||||
|
||||
getcontext().prec = 2 # use 2 significant figures for decimal calculations
|
||||
|
||||
import settings
|
||||
@@ -73,7 +75,14 @@ def alphabet_suffix(n):
|
||||
suffix = alphabet[n-1]
|
||||
else:
|
||||
suffix = "_X_" + random.choice(string.ascii_lowercase) + random.choice(string.ascii_lowercase)
|
||||
return suffix
|
||||
return suffix
|
||||
|
||||
def current_expo():
|
||||
expos = Expedition.objects.all().order_by('-year')
|
||||
if expos:
|
||||
return expos[0].year
|
||||
else:
|
||||
return "1970"
|
||||
|
||||
def only_commit(fname, message):
|
||||
"""Only used to commit a survex file edited and saved in view/survex.py"""
|
||||
|
||||
Reference in New Issue
Block a user