0001-general-do-not-expose-links-to-existing-media-files-.patch
passerelle/views.py | ||
---|---|---|
18 | 18 |
from django.utils.translation import ugettext_lazy as _ |
19 | 19 |
from django.utils.encoding import force_text |
20 | 20 |
from django.forms.models import modelform_factory |
21 |
from django.forms.widgets import ClearableFileInput |
|
21 | 22 | |
22 | 23 |
if 'mellon' in settings.INSTALLED_APPS: |
23 | 24 |
from mellon.utils import get_idps |
... | ... | |
114 | 115 |
else: |
115 | 116 |
self.form_class = modelform_factory(self.model, |
116 | 117 |
form=GenericConnectorForm, exclude=('slug', 'users')) |
118 |
for field in self.form_class.base_fields.values(): |
|
119 |
if isinstance(field.widget, ClearableFileInput): |
|
120 |
field.widget.template_with_initial = ''\ |
|
121 |
'%(initial_text)s: %(initial)s '\ |
|
122 |
'%(clear_template)s<br />%(input_text)s: %(input)s' |
|
123 | ||
117 | 124 | |
118 | 125 |
def dispatch(self, request, *args, **kwargs): |
119 | 126 |
self.init_stuff(request, *args, **kwargs) |
120 |
- |