Merge "Only allow http/https schemas for image download"
This commit is contained in:
commit
fc64d3b191
@ -19,7 +19,9 @@
|
|||||||
"""
|
"""
|
||||||
Views for managing images.
|
Views for managing images.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.core import validators
|
||||||
from django.forms import ValidationError # noqa
|
from django.forms import ValidationError # noqa
|
||||||
from django.forms.widgets import HiddenInput # noqa
|
from django.forms.widgets import HiddenInput # noqa
|
||||||
from django.template import defaultfilters
|
from django.template import defaultfilters
|
||||||
@ -102,6 +104,8 @@ class CreateImageForm(forms.SelfHandlingForm):
|
|||||||
'ng-model': 'copyFrom',
|
'ng-model': 'copyFrom',
|
||||||
'ng-change':
|
'ng-change':
|
||||||
'ctrl.selectImageFormat(copyFrom)'}),
|
'ctrl.selectImageFormat(copyFrom)'}),
|
||||||
|
validators=[validators.URLValidator(
|
||||||
|
schemes=["http", "https"])],
|
||||||
required=False)
|
required=False)
|
||||||
image_file = forms.FileField(label=_("Image File"),
|
image_file = forms.FileField(label=_("Image File"),
|
||||||
help_text=_("A local image to upload."),
|
help_text=_("A local image to upload."),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user