Skip to content

Commit

Permalink
Fix 502 error when a menu link has a service and URL with a scheme
Browse files Browse the repository at this point in the history
Error 502 happened if a menu link had a preconfigured
service and a URL with a scheme set.

Fixes #1394
  • Loading branch information
ihalaij1 committed Aug 20, 2024
1 parent 5733d53 commit 21e775f
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 201 deletions.
4 changes: 4 additions & 0 deletions external_services/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ def clean(self):
errors['menu_label'] = ValidationError(_(
'MENU_ITEM_ERROR_MENU_LABEL_REQUIRED_WHEN_NO_PRECONFIGURED_SERVICE_SELECTED'
))
if self.service and self.menu_url and '://' in self.menu_url:
errors['menu_url'] = ValidationError(_(
'MENU_ITEM_ERROR_SCHEME_IN_MENU_URL_AND_PRECONFIGURED_SERVICE_SELECTED'
))
if errors:
raise ValidationError(errors)

Expand Down
Loading

0 comments on commit 21e775f

Please sign in to comment.