Commit 234b4100 authored by D.H.D. Nguyen's avatar D.H.D. Nguyen
Browse files

add validators

parent 3bdd6331
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
@@ -78,13 +78,12 @@ def batch(p_name, batch_id):
		# Submit Button
		if request.form['action'] == 'submit':

			if all([form.validate_on_submit() for form in forms]):

			# in case this person has opened this batch more than once and already submitted but still 
			# wants to submit this batch again
			if current_batch in current_annotator.batches:
				flash(f'Batch {batch_id} already submitted!', 'action')
				else:

			if all([form.validate_on_submit() for form in forms]):

				for form, tuple_ in zip(forms, current_batch.tuples):
					if Data.query.filter_by(annotator=current_annotator, tuple_=tuple_).first():