Skip to content

Commit

Permalink
Fix URL validation
Browse files Browse the repository at this point in the history
The `public` parameter looks to be broken ¹.

¹ python-validators/validators#309
  • Loading branch information
nicolafio committed Mar 18, 2024
1 parent 96bb293 commit 6e745ee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions web-api/app/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def _get_user_representation(user):
return representation


def _is_external_url(url):
return validators.url(url, public = True)

@bp.route("/<user>", methods = ["GET"])
@auth_key_required
@user_existence_required
Expand Down Expand Up @@ -93,7 +90,7 @@ def _create_or_update_user(user):
})

for field in ["timesheet", "schedule"]:
if field in request_data and not _is_external_url(request_data[field]):
if field in request_data and not validators.url(request_data[field]):
validation_problems.append({
"field": field,
"reason": "must be a valid URL"
Expand Down

0 comments on commit 6e745ee

Please sign in to comment.