Development

This commit is contained in:
Matthew Grotke 2026-05-24 02:42:11 -04:00
parent c8607ba8c5
commit e289583c4b
3 changed files with 55 additions and 22 deletions

View file

@ -112,10 +112,15 @@ def ddns_cardlog_save():
@bp.route('/action/ddns_cardinterval_save', methods=['POST'])
@require_level('administrator')
def ddns_cardinterval_save():
timer_interval = request.form.get('timer_interval', '').strip()
if not re.match(r'^\d+[mhd]$', timer_interval):
flash('Invalid interval. Use a number followed by m, h, or d (e.g. 10m, 1h).', 'error')
raw = request.form.get('timer_interval', '').strip()
try:
mins = int(raw)
if mins < 1:
raise ValueError
except ValueError:
flash('Interval must be a whole number of minutes >= 1.', 'error')
return redirect(VIEW)
timer_interval = f'{mins}m'
if not verify_core_hash(request.form.get('config_hash', '')):
flash('Configuration was modified by another session. Please refresh and try again.', 'error')
return redirect(VIEW)