Open baxpr opened 2 years ago
pyxnat is insistent on printing some error messages when it gets a 404: https://github.com/pyxnat/pyxnat/blob/59a53b759e4382cd7de653bcfb0b45249bf1e4ef/pyxnat/core/interfaces.py#L357
Is that the same thing we're seeing here?
Xnatupload prints an error message along the lines of "Subject/session not found" when trying to upload data to a new subject or session. But, it gets the upload done anyway. This should just work without throwing an error - I think we just need to explicitly check subject.exists() first, and create it if not, before trying to access session. Same for session.exists() before trying to access scans.