diff --git a/openstack_dashboard/dashboards/project/images/images/forms.py b/openstack_dashboard/dashboards/project/images/images/forms.py index 9dacdda73e..8c00381506 100644 --- a/openstack_dashboard/dashboards/project/images/images/forms.py +++ b/openstack_dashboard/dashboards/project/images/images/forms.py @@ -19,7 +19,9 @@ """ Views for managing images. """ + from django.conf import settings +from django.core import validators from django.forms import ValidationError # noqa from django.forms.widgets import HiddenInput # noqa from django.template import defaultfilters @@ -102,6 +104,8 @@ class CreateImageForm(forms.SelfHandlingForm): 'ng-model': 'copyFrom', 'ng-change': 'ctrl.selectImageFormat(copyFrom)'}), + validators=[validators.URLValidator( + schemes=["http", "https"])], required=False) image_file = forms.FileField(label=_("Image File"), help_text=_("A local image to upload."),