def _validate_key(download_key):
    download_key = download_key.lower()
    if not SHA1_RE.search(download_key):
        error_message = _("The download key is invalid.")
        return (False, error_message, None)
    try:
        dl_product = DownloadLink.objects.get(key=download_key)
    except:
        error_message = _("The download key is invalid.")
        return (False, error_message, None)
    valid, msg = dl_product.is_valid()
    if not valid:
        return (False, msg, None)
    else:
        return (True, None, dl_product)
Helper function to make sure the key is valid and all the other constraints on
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/modules/downloadable/views.py/_validate_key