We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
media_format
1 parent 795c984 commit ce2e675Copy full SHA for ce2e675
tubesync/sync/forms.py
@@ -1,5 +1,6 @@
1
2
from django import forms, VERSION as DJANGO_VERSION
3
+from django.conf import settings
4
from django.utils.translation import gettext_lazy as _
5
6
from .models import Source
@@ -29,6 +30,12 @@
29
30
},
31
)
32
33
+def source_clean_media_format(self):
34
+ data = self.cleaned_data.get('media_format', '').strip()
35
+ return data or getattr(settings, 'MEDIA_FORMATSTR', settings.MEDIA_FORMATSTR_DEFAULT)
36
+
37
+SourceForm.clean_media_format = source_clean_media_format
38
39
class ValidateSourceForm(forms.Form):
40
41
source_url = forms.URLField(
0 commit comments