Skip to content

Commit

Permalink
Merge pull request #1019 from ScilifelabDataCentre/rm-regex-fix
Browse files Browse the repository at this point in the history
change delete_folder regex
  • Loading branch information
i-oden authored Mar 8, 2022
2 parents 288f5ab + d6f93e5 commit 3104aaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dds_web/api/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,12 @@ def delete_folder(self, project, folder):
.filter(
sqlalchemy.or_(
models.File.subpath == sqlalchemy.func.binary(folder),
models.File.subpath.regexp_match(rf"^{folder}(/[^/]+)*$"),
models.File.subpath.regexp_match(rf"^{folder}(\/[^\/]+)*$"),
)
)
.all()
)

except sqlalchemy.exc.SQLAlchemyError as err:
raise DatabaseError(message=str(err))

Expand Down

0 comments on commit 3104aaa

Please sign in to comment.