Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ #993 ADD celery task 1: every day check that extracts ever… #1018

Merged
merged 17 commits into from
Dec 10, 2024

Conversation

stefrado
Copy link
Contributor

Fixes #993


  • ✨ ADD celery task 1: every day check that extracts every URL from each localized product and checks if the URL is valid
  • ✨ ADD celery task 2: send every month send monthly report bout the links

@stefrado stefrado self-assigned this Dec 10, 2024
src/sdg/templates/producten/email/email_broken_links.html Outdated Show resolved Hide resolved
Comment on lines 49 to 52
product_dict = defaultdict(lambda: defaultdict(list))
url_set = set()
url_response_status_codes = defaultdict(int)
founded_broken_link_ids = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use class-level attributes (that are initialized).

If you find this is needed because multiple functions are writing or reading the same class-variable, then the functions are incorrect or you need to pass the data around as argument to the next function.

For example, your function get_products_to_check doesn't "get" products. It fills a variable with products. Just, make this function return the products instead of filling a class-level variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to fix this in adc0602

@stefrado stefrado merged commit f742b05 into dev Dec 10, 2024
10 checks passed
@stefrado stefrado deleted the 993-foutieve-links__new branch December 10, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants