+ return [self._gsiftp_suffix(item) for item in self.cleaned_data['stage_in']]
+
+ def clean_preprocess_script(self):
+ return self._gsiftp_suffix(self.cleaned_data['preprocess_script'])
+
+ def clean_postprocess_script(self):
+ return self._gsiftp_suffix(self.cleaned_data['postprocess_script'])
+
+ @staticmethod
+ def _gsiftp_suffix(url):
+ if url:
+ return url if url.startswith('gsiftp://') else 'gsiftp://' + url
+
+ def _init_user_choices(self, name, data, initial):
+ initial = initial.get(name) if initial is not None else None
+ choices = data.getlist(name) if data is not None else []
+
+ if initial:
+ choices += initial if isinstance(initial, list) else [initial]
+ self.fields[name].initial = initial
+
+ if choices:
+ self.fields[name].choices += ((v, v) for v in choices)
+