Prevent observations from being scheduled in the past
If a user opens a schedule page and calculates the observation but let it sit beyond the time that the observation would have happened it is possible to submit an observation in the past. This change fixes that. Fixes librespacefoundation/satnogs/satnogs-network#422merge-requests/453/head
parent
9695601e29
commit
15bcb0f6f7
|
@ -224,6 +224,10 @@ def observation_new(request):
|
|||
messages.error(request, 'Please use the datetime dialogs to submit valid timeframe.')
|
||||
return redirect(reverse('base:observation_new'))
|
||||
|
||||
if (start_time < datetime.now()):
|
||||
messages.error(request, 'Please schedule an observation that begins in the future')
|
||||
return redirect(reverse('base:observation_new'))
|
||||
|
||||
start = make_aware(start_time, utc)
|
||||
end = make_aware(end_time, utc)
|
||||
sat = Satellite.objects.get(norad_cat_id=sat_id)
|
||||
|
|
Loading…
Reference in New Issue