def refresh_certs(realm):
    """
    :param django_keycloak.models.Realm realm:
    :rtype django_keycloak.models.Realm
    """
    realm.certs = realm.client.openid_api_client.certs()
    realm.save(update_fields=['_certs'])
    return realm
