Skip to content

Commit

Permalink
articles: disable compliance
Browse files Browse the repository at this point in the history
Signed-off-by: pamfilos <[email protected]>
  • Loading branch information
pamfilos committed Dec 18, 2024
1 parent ab6c93c commit 49be1be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,5 @@ def filter(self, record):
MATOMO_SITE_ID = env("MATOMO_SITE_ID", default="")

PROMETHEUS_EXPORT_MIGRATIONS = env.bool("PROMETHEUS_EXPORT_MIGRATIONS", True)

COMPLIANCE_DISABLED = env.bool("COMPLIANCE_DISABLED", False)
4 changes: 4 additions & 0 deletions scoap3/articles/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.core.paginator import Paginator
from django_opensearch_dsl.registries import registry

from config import COMPLIANCE_DISABLED
from scoap3.articles.models import Article, ArticleFile, ComplianceReport
from scoap3.articles.util import is_string_in_pdf
from scoap3.authors.models import Author
Expand Down Expand Up @@ -181,6 +182,9 @@ def check_contains_funded_by_scoap3(article):

@shared_task(name="compliance_checks", acks_late=True)
def compliance_checks(article_id):
if COMPLIANCE_DISABLED:
return f"compliance disabled:: article {str(article_id)}"

try:
article = Article.objects.get(id=article_id)
except Article.DoesNotExist:
Expand Down

0 comments on commit 49be1be

Please sign in to comment.