X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=f66ada600b7e80192d7b2cd9edabe02bfcce96a9;hb=562511e3faaa87a7082033c45f7ed2c788a2ef50;hp=3a5b63767fc274164f2989ee5e1744cd1cf90717;hpb=1b76c73420af7e025fb758862a9dc297ffc64981;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index 3a5b637..f66ada6 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -195,21 +195,10 @@ class JobDescriptionForm(forms.Form): data['postprocess'] = '' def clean_application(self): - value = self.cleaned_data['application'] - - if '/' in value: - return value.split('/', 1) - - return value, None + return self.cleaned_data['application'].split('/', 1) def clean_nodes(self): - value = map(int, self.cleaned_data['nodes'].split(':', 2)) - - if len(value) == 3: - return tuple(value) - - nodes, slots = value - return nodes, slots, slots + return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else None class EnvForm(forms.Form):