idolezal commited on
Commit
bc51cbc
β€’
1 Parent(s): b35e51f

Fixed `submission_file == None`

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -33,11 +33,10 @@ SUBMISSION_INPUTS = dict.fromkeys((
33
  def on_submit_pressed():
34
  return gr.update(value='Processing submission...', interactive=False)
35
 
36
-
37
- def validate_submission_inputs(**kwargs):
38
- if SUBMISSION_INPUTS - set(kwargs) != set():
39
  raise ValueError('Please fill in all fields')
40
- if not os.path.exists(kwargs["submission_file"]):
41
  raise ValueError('File does not exist')
42
 
43
  def process_submission(*inputs):
 
33
  def on_submit_pressed():
34
  return gr.update(value='Processing submission...', interactive=False)
35
 
36
+ def validate_submission_inputs(**inputs):
37
+ if any(key for key, value in inputs.items() if value in (None, "")):
 
38
  raise ValueError('Please fill in all fields')
39
+ if not os.path.exists(inputs["submission_file"]):
40
  raise ValueError('File does not exist')
41
 
42
  def process_submission(*inputs):