Check if such an assignment configuration makes sense, and reject it otherwise.
            This mainly relates to interdependencies between the different fields, since
            single field constraints are already clatified by the Django model configuration.

def clean(self):
        '''
            Check if such an assignment configuration makes sense, and reject it otherwise.
            This mainly relates to interdependencies between the different fields, since
            single field constraints are already clatified by the Django model configuration.
        '''
        super(AssignmentAdminForm, self).clean()
        d = defaultdict(lambda: False)
        d.update(self.cleaned_data)
        # Having validation or full test enabled demands file upload
        if d['attachment_test_validity'] and not d['has_attachment']:
            raise ValidationError('You cannot have a validation script without allowing file upload.')
        if d['attachment_test_full'] and not d['has_attachment']:
            raise ValidationError('You cannot have a full test script without allowing file upload.')
        # Having validation or full test enabled demands a test machine
        if d['attachment_test_validity'] and 'test_machines' in d and not len(d['test_machines'])>0:
            raise ValidationError('You cannot have a validation script without specifying test machines.')
        if d['attachment_test_full'] and 'test_machines' in d and not len(d['test_machines'])>0:
            raise ValidationError('You cannot have a full test script without specifying test machines.')
        if d['download'] and d['description']:
            raise ValidationError('You can only have a description link OR a description file.')
        if not d['download'] and not d['description']:
            raise ValidationError('You need a description link OR a description file.')
        # Having test machines demands compilation or validation scripts
        if 'test_machines' in d and len(d['test_machines'])>0               \
            and not 'attachment_test_validity' in d  \
            and not 'attachment_test_full' in d:
            raise ValidationError('For using test machines, you need to enable validation or full test.')