Skip to content

Commit

Permalink
Don't overwrite the original variable
Browse files Browse the repository at this point in the history
  • Loading branch information
talavis committed Mar 9, 2022
1 parent d34b378 commit bd2fc37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Please add a _short_ line describing the PR you make, if the PR implements a spe
- Include frontend build in the backend production target ([#1011](https://github.com/ScilifelabDataCentre/dds_web/pull/1011))
- Correct response about project being created when email validation fails for users ([#1014](https://github.com/ScilifelabDataCentre/dds_web/pull/1014))
- Introduced an additional validator `dds_web.utils.contains_disallowed_characters` to fix issue [#1007](https://github.com/scilifelabdatacentre/dds_web/issues/1007) ([#1021](https://github.com/ScilifelabDataCentre/dds_web/pull/1021)).
- Fix regex for listing and deleting files [#1029](https://github.com/scilifelabdatacentre/dds_web/issues/1029)
4 changes: 2 additions & 2 deletions dds_web/api/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def delete_folder(self, project, folder):
"""Delete all items in folder"""
exists = False
names_in_bucket = []
folder = re.escape(folder)
re_folder = re.escape(folder)
try:
# File names in root
files = (
Expand All @@ -530,7 +530,7 @@ 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"^{re_folder}(/[^/]+)*$"),
)
)
.all()
Expand Down

0 comments on commit bd2fc37

Please sign in to comment.