Skip to content

Project import happily assumes a path is in common when it doesn't exist #61

@moi90

Description

@moi90

def unzip_if_needed(self, owner_id: UserIDT) -> str:

If UserDirectory(owner_id) does not contain the file, it is assumed that it is in CommonFolder(self.config.common_folder()).
This leads to the later error message: No object to import.<br>* No .txt or .tsv file was found, of which name starts with 'ecotaxa'. It is not obvious from that message that the supplied path was wrong.

It would be better to validate the path early on.

Also, UserDirectory.contains is a coarse heuristic. Furthermore, this would be the place to fix #56 and #60:

I would let UserDirectory and CommonFolder calculate the absolute path of the supplied filename and check which of both exists (and is below the user or common directory). The only remaining problem would be that a name could exist in both directories, so that the choice is ambiguous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions