Merge "Only allow http/https schemas for image download"
This commit is contained in:
commit
fc64d3b191
@ -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."),
|
||||
|
Loading…
Reference in New Issue
Block a user