Ver código fonte

Only enforce login on action=search

Login is being enforced if `use_engine` is True, which is its default
value. This currently also affects `compare` actions, which don't use
the `use_engine` parameter. This updates the check such that login is
only required when the `action` is `search`.
pull/72/head
Chlod Alejandro 1 mês atrás
pai
commit
1ec7108b40
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: A1E67C59037B0CC1
1 arquivos alterados com 2 adições e 1 exclusões
  1. +2
    -1
      src/copyvios/checker.py

+ 2
- 1
src/copyvios/checker.py Ver arquivo

@@ -56,7 +56,8 @@ def do_check(query: CheckQuery) -> CopyvioCheckResult | None:
is_logged_in = _get_username() is not None is_logged_in = _get_username() is not None
config_bypass = current_app.config.get("COPYVIOS_BYPASS_LOGIN", False) config_bypass = current_app.config.get("COPYVIOS_BYPASS_LOGIN", False)
if ( if (
query.use_engine
query.action == "search"
and query.use_engine
and not is_logged_in and not is_logged_in
and not isinstance(query, APIQuery) and not isinstance(query, APIQuery)
and not config_bypass and not config_bypass


Carregando…
Cancelar
Salvar