Skip to content

Commit

Permalink
Fix/shiny form path error (#286)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Churikov <8545082+churnikov@users.noreply.github.com>
  • Loading branch information
hamzaimran08 and churnikov authored Feb 25, 2025
1 parent 7b287c3 commit 33acd64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/forms/shiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def clean_path(self):
# If new path matches current path, it is valid.
if self.instance and getattr(self.instance, "path", None) == path:
return path
# Verify that path starts with "/home"
# Verify that path starts with "/home" or "/srv"
path = path.strip().rstrip("/").lower().replace(" ", "")
if not path.startswith("/home"):
self.add_error("path", 'Path must start with "/home"')
if not path.startswith(("/home", "/srv")):
self.add_error("path", 'Path must start with "/home" or "/srv"')

return path

Expand Down

0 comments on commit 33acd64

Please sign in to comment.