spradio-server-django/savepointradio/radio/forms.py
2019-06-06 15:45:56 -04:00

20 lines
526 B
Python

'''
Custom forms/formfields for the Save Point Radio project.
'''
from django.forms.fields import URLField
from core.validators import RadioIRIValidator
class RadioIRIFormField(URLField):
'''
A custom URL form field that allows schemes that match those from
Liquidsoap. This is necessary due to a bug in how Django currently
handles custom URLFields:
https://code.djangoproject.com/ticket/25594
https://stackoverflow.com/questions/41756572/
'''
default_validators = [RadioIRIValidator()]