-
Notifications
You must be signed in to change notification settings - Fork 0
272 dashboard create one endpoint for articles with proper status #357
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
Changes from all commits
0fac0c9
d39d7a8
4ca1b56
0d51089
53117ea
9a55982
9b17eb4
920c75b
045447b
5a58d8b
5b6701e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
| from django.utils.html import strip_tags | ||
|
|
||
| from jdhapi.utils.doi import get_doi_url_formatted_jdh | ||
| from jdhapi.models import Author, Tag | ||
| from jdhapi.models import Article, Author, Tag | ||
|
|
||
| from jdhseo.utils import getReferencesFromJupyterNotebook | ||
| from requests.exceptions import HTTPError | ||
|
|
@@ -217,6 +217,18 @@ def get_citation(raw_url, article): | |
| } | ||
|
|
||
|
|
||
| def save_citation(article_id): | ||
| logger.info(f"save_article_citation:{article_id}") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to write the name of the function, write instead 'save_citation', so that for debugging we know exactly what to look for :) |
||
| try: | ||
| article = Article.objects.get(pk=article_id) | ||
| except Article.DoesNotExist: | ||
| logger.error(f"save_article_citation:{article_id} not found") | ||
| return | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe here do a |
||
| citation = get_citation(raw_url=article.notebook_ipython_url, article=article) | ||
| article.citation = citation | ||
| article.save() | ||
|
|
||
|
|
||
| def get_raw_from_github( | ||
| repository_url, file_type, host="https://raw.githubusercontent.com" | ||
| ): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add SOCIAL_MEDIA and ARCHIVED.