def METHOD_NAME(self, data):
    """Validate inputs.
    Make sure both confirm and url are provided.
    """
    super().METHOD_NAME(data)
    # check the base requirements are met
    if not data.get('confirm'):
        raise ValidationError({'confirm': _('Installation not confirmed')})
    if (not data.get('url')) and (not data.get('packagename')):
        msg = _('Either packagename of URL must be provided')
        raise ValidationError({'url': msg, 'packagename': msg})
    return data