-
Notifications
You must be signed in to change notification settings - Fork 10
Adiciona trigger para atualizar os dados de coleção no opac_5 #1156
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
Open
samuelveigarangel
wants to merge
38
commits into
scieloorg:main
Choose a base branch
from
samuelveigarangel:issue-opac-339
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
df2b135
add cryptography e PyJWT
samuelveigarangel 02f061e
Remove field size de BaseLogo
samuelveigarangel 22f9159
Add purpose em Collection
samuelveigarangel cf7b1a1
Adiciona url e logo_url
samuelveigarangel 1d730b2
Remove LOGO_SIZE
samuelveigarangel a57d962
Add LOGO_PURPOSE
samuelveigarangel 16d4349
Var de ambiente local
samuelveigarangel 03e82f7
Adiciona variaveis de ambiente relacionado a JWT
samuelveigarangel 45b4f04
Adiciona classe ListSerializer para agrupar logos por purpose e ficar…
samuelveigarangel 247bfdd
Adiciona signal e codificação do token para mandar requisições post p…
samuelveigarangel 4cf1d9b
fix header
samuelveigarangel 9511cc5
migration
samuelveigarangel 823d7fe
remove jwt_private_local.pem
samuelveigarangel 36dd9fb
Adiciona variável para ativar update da coleção em opac_5
samuelveigarangel 5bb31a7
remove event em build_collection_webhook
samuelveigarangel 4e5e7b4
remove ip fixo
samuelveigarangel d7bae8f
Merge branch 'main' into issue-opac-339
samuelveigarangel 37c06aa
remove value JWT_PRIVATE_KEY_PATH
samuelveigarangel f79d60d
Cria função para ler chave privada
samuelveigarangel cdffec6
muda metodo post para get em fetch_with_schema_guess
samuelveigarangel c76f5ed
Muda nome da funcao fetch_with_schema_guess para fetch_with_protocol_…
samuelveigarangel cdee2ec
Move logging.error para handler exception
samuelveigarangel a9a4b3e
remove span duplicado
samuelveigarangel f5e1bf7
Merge branch 'issue-opac-339' of github.com:samuelveigarangel/core in…
samuelveigarangel b234dfa
Merge branch 'main' into issue-opac-339
samuelveigarangel e6e6f50
remove self.size em BaseLogo.__str__
samuelveigarangel 36bdc83
refactor get_logo_url
samuelveigarangel 3e8c2a9
Refactor get_logo_url
samuelveigarangel 24640cf
fix: corrige validações e chamadas duplicadas em webhooks de coleção
samuelveigarangel 8857316
Merge branch 'main' into issue-opac-339
samuelveigarangel 1e3e1e8
Merge branch 'issue-opac-339' of github.com:samuelveigarangel/core in…
samuelveigarangel 22344ae
organiza e remove imports
samuelveigarangel cd1e4cd
migration merge
samuelveigarangel b5091f4
Transforma leitura da chave privada em variavel de ambiente
samuelveigarangel 98ff528
Merge branch 'main' into issue-opac-339
samuelveigarangel e530db2
Add validação de tamanho para logos
samuelveigarangel 627ab2c
Fix build_collection_webhook
samuelveigarangel d43f61d
Cria funções para obter url de Imagefield e wagtail.images
samuelveigarangel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| JWT_ISS="https://api.seu-django.com" | ||
| JWT_AUD="seu-flask-servico" | ||
| JWT_EXP_SECONDS=600 | ||
| JWT_ALG="RS256" | ||
| # JWT_PRIVATE_KEY JA CORRESPONDENTE AO jwt_public OPAC_5 PARA TESTES. | ||
| JWT_PRIVATE_KEY_PATH= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
collection/migrations/0007_alter_collectionexecutingorganization_options_and_more.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Generated by Django 5.2.3 on 2025-09-25 17:30 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ( | ||
| "collection", | ||
| "0006_alter_collection_options_alter_collection_acron2_and_more", | ||
| ), | ||
| ("core", "0007_alter_language_options_alter_license_options_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name="collectionexecutingorganization", | ||
| options={ | ||
| "ordering": ["sort_order"], | ||
| "verbose_name": "Executing Organization", | ||
| "verbose_name_plural": "Executing Organizations", | ||
| }, | ||
| ), | ||
| migrations.AlterModelOptions( | ||
| name="collectionlogo", | ||
| options={ | ||
| "ordering": ["sort_order", "language"], | ||
| "verbose_name": "Collection Logo", | ||
| "verbose_name_plural": "Collection Logos", | ||
| }, | ||
| ), | ||
| migrations.AlterModelOptions( | ||
| name="collectionsupportingorganization", | ||
| options={ | ||
| "ordering": ["sort_order"], | ||
| "verbose_name": "Supporting Organization", | ||
| "verbose_name_plural": "Supporting Organizations", | ||
| }, | ||
| ), | ||
| migrations.AlterUniqueTogether( | ||
| name="collectionlogo", | ||
| unique_together={("collection", "language", "purpose")}, | ||
| ), | ||
| migrations.AddField( | ||
| model_name="collectionlogo", | ||
| name="purpose", | ||
| field=models.CharField( | ||
| blank=True, | ||
| choices=[ | ||
| ("homepage", "Homepage"), | ||
| ("header", "Header"), | ||
| ("logo_drop_menu", "Logo drop menu"), | ||
| ("footer", "Footer"), | ||
| ("menu", "Menu"), | ||
| ], | ||
| help_text="Select the purpose of this logo", | ||
| max_length=20, | ||
| ), | ||
| ), | ||
| migrations.RemoveField( | ||
| model_name="collectionlogo", | ||
| name="size", | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Generated by Django 5.2.3 on 2025-10-28 04:12 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("collection", "0007_alter_collectionexecutingorganization_options_and_more"), | ||
| ("collection", "0007_collection_platform_status"), | ||
| ] | ||
|
|
||
| operations = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from django.db import transaction | ||
| from django.db.models.signals import post_save | ||
| from django.dispatch import receiver | ||
| from django.conf import settings | ||
| from .models import Collection | ||
| from .tasks import build_collection_webhook | ||
|
|
||
|
|
||
| @receiver(post_save, sender=Collection, dispatch_uid="collection.signals.post_save") | ||
| def collection_post_save(sender, instance, created, **kwargs): | ||
| def _on_commit(): | ||
| if settings.ACTIVATE_UPDATE_COLLECTION_WEBHOOK: | ||
| event = "collection.created" if created else "collection.updated" | ||
| build_collection_webhook.apply_async( | ||
| kwargs=dict( | ||
| event=event, | ||
| collection_acron=instance.acron3, | ||
| # headers=headers, | ||
| ) | ||
| ) | ||
| transaction.on_commit(_on_commit) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nitpick] The unique constraint uses single quotes while other parts of the codebase use double quotes for consistency. Consider using double quotes.