

def clean(self):
    data = super(CreateImageForm, self).clean()
    image_file = data.get('image_file', None)
    if ((not self['copy_from']) and (not image_file)):
        raise ValidationError(_('A image or external image location must be specified.'))
    elif (data['copy_from'] and image_file):
        raise ValidationError(_('Can not specify both image and external image location.'))
    else:
        return data

dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/images_and_snapshots/images/forms.py CreateImageForm.clean/VarMisuse@38/47 `data`->`self`