"if wait" rather than "if wait is not None". Also change the default to 0.
Attach a file by drag & drop or click to upload