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

[fix] Issue with use of DRF serializers in webhook #1032

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

etchegom
Copy link
Collaborator

@etchegom etchegom commented Feb 11, 2025

Il s'agit de :

  • Une correction de bug
  • Une nouvelle fonctionnalité programmée
  • Une nouvelle fonctionnalité spontanée

Décrivez vos changements

J'avais désactivé les champs _link des payloads de l'API, à cause d'une erreur sur la partie webhook, qui utilise les serializers DRF, mais sans contexte.
J'ai fait ce fix pour les réactiver, en ajoutant un test coté webhook.

Checklist d'acceptation de revue de code

  • Aucun texte ne fait référence à du vocabulaire spécifique d'un métier
  • Mon code est auto-documenté ou la documentation a été mise à jour/créée
  • La gestion du multi-portail a été prise en compte
  • L'accessibilité a été prise en compte
  • Pre-commit est configuré et a été lancé
  • Des tests couvrant le code changé ont été ajoutés/modifiés
  • L'ensemble des tests front et back sont au vert

Demandes

  • Je souhaite un déploiement en préproduction

@etchegom etchegom self-assigned this Feb 11, 2025
@etchegom etchegom changed the title [fix] Issue with use of DRF serialiazers in webhook [fix] Issue with use of DRF serializers in webhook Feb 11, 2025
@etchegom etchegom force-pushed the fix/webhook-serializers branch from 5fa79e3 to b3ccbeb Compare February 11, 2025 14:56
@etchegom etchegom force-pushed the fix/webhook-serializers branch from b3ccbeb to 21c17fc Compare February 17, 2025 07:47
@@ -36,11 +36,13 @@ def find_webhooks(self, topic: str, instance: Any) -> list[tuple[int, str]]:
)

def model_dict(self, instance: Any) -> dict[str, Any]:
kwargs = {"context": {"request": None}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Il faut juste qu'un objet request soit présent dans le contexte, même si il est à None.

@etchegom etchegom marked this pull request as ready for review February 17, 2025 07:51
Copy link
Collaborator

@glibersat glibersat left a comment

Choose a reason for hiding this comment

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

Au top, merci d'avoir pensé à le remettre au carré après le fix rapide !

@glibersat glibersat merged commit 0b1a682 into develop Feb 18, 2025
6 checks passed
@glibersat glibersat deleted the fix/webhook-serializers branch February 18, 2025 08:19
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