Esempio n. 1
0
def check_avatars(app_configs, **kwargs):
    if not settings.ENABLE_AVATARS:
        return []
    try:
        download_avatar_image("*****@*****.**", 32)
        return []
    except (OSError, CertificateError) as error:
        return [weblate_check("weblate.E018", f"Failed to download avatar: {error}")]
Esempio n. 2
0
def check_avatars(app_configs, **kwargs):
    from weblate.auth.models import get_anonymous
    from weblate.accounts.avatar import download_avatar_image

    if not settings.ENABLE_AVATARS:
        return []
    try:
        download_avatar_image(get_anonymous(), 32)
        return []
    except (IOError, CertificateError) as error:
        return [weblate_check("weblate.E018", f"Failed to download avatar: {error}")]
Esempio n. 3
0
def check_avatars(app_configs, **kwargs):
    from weblate.auth.models import get_anonymous
    from weblate.accounts.avatar import download_avatar_image
    if not settings.ENABLE_AVATARS:
        return []
    try:
        download_avatar_image(get_anonymous(), 32)
        return []
    except (IOError, CertificateError) as error:
        return [
            Critical(
                'Failed to download avatar: {}'.format(error),
                hint=get_doc_url('admin/optionals', 'avatars'),
                id='weblate.E018',
            )
        ]