file.py fix duplicate file check
The query designed to allow the controller to check whether a file already exists within the set(s) to which it is being uploaded was checking against patients in all cases leading to some odd behaviour.
Closes #2855 (closed)