Skip to content

Fiche de poste : Le badge 20+ candidatures sur les résultats de recherche n’est pas compris et induit en erreur [GEN-2036] - #6422

Merged
dejafait merged 2 commits into
masterfrom
dejafait/change_search_badge_logic
Jun 30, 2025
Merged

dejafait merged 2 commits into
masterfrom
dejafait/change_search_badge_logic

Conversation

@dejafait

@dejafait dejafait commented Jun 26, 2025 •

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Au lieu d’indiquer 20+ candidatures, afficher le badge Soyez parmi les premiers à postuler sur les postes qui ont reçu N ou moins candidatures récentes.

N=0 pour commencer. Finalement N=1 et ce sera facile à ajuster (cf troisième commit).

🍰 Comment ?

On change la logique du badge existant : au lieu de le montrer si 20 ou plus candidatures, on le montre si N ou moins candidatures.

Dans le futur on pourra facilement ajuster le seuil N.

💻 Captures d'écran

recherche employeurs

image

recherche fiches de poste

image

@dejafait dejafait self-assigned this Jun 26, 2025
@dejafait dejafait added the modifié Modifié dans le changelog. label Jun 26, 2025
@notion-workspace

Copy link
Copy Markdown

@dejafait
dejafait marked this pull request as draft June 26, 2025 11:51
@dejafait
dejafait force-pushed the dejafait/change_search_badge_logic branch 2 times, most recently from 2a3a7fd to f99c43c Compare June 26, 2025 12:33
@dejafait
dejafait marked this pull request as ready for review June 26, 2025 12:50
@dejafait
dejafait requested a review from tonial June 26, 2025 12:51
@dejafait
dejafait force-pushed the dejafait/change_search_badge_logic branch from dca213e to 11c11bd Compare June 26, 2025 13:29

@tonial tonial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Je pense que tu peux squasher un grand nombre de commits (voir tous les commits à l'exception peut être de job_descriptions: limit badge logic to recent jobapps)
Il manque quelques tests sur ce commit là

Comment thread itou/companies/models.py Outdated

MAX_UI_RANK = 32767
OVERWHELMED_THRESHOLD = 20
UNPOPULAR_THRESHOLD = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

C'est dommage de ne pas mettre tout de suite 2 ici (peut être que la valeur a changé au cours du développement du ticket, en tout cas, ça vaut le coup de mettre la bonne valeur dès le début en fusionnant les commits suivants qui changent sa valeur)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok je vais squasher.

Comment thread itou/companies/models.py
Comment thread tests/companies/test_models.py
Comment thread itou/companies/models.py
@dejafait
dejafait force-pushed the dejafait/change_search_badge_logic branch from 8e15161 to 54c9817 Compare June 26, 2025 15:24
@dejafait
dejafait force-pushed the dejafait/change_search_badge_logic branch from 54c9817 to 7873149 Compare June 26, 2025 15:24
@dejafait
dejafait requested a review from tonial June 26, 2025 15:27

@tonial tonial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Je te laisse ignorer mon commentaire si tu n'es pas d'accord :)

Comment thread itou/companies/models.py
def with_annotation_is_unpopular(self):
annotation = self.with_job_applications_count().annotate(
# Avoid a circular import
job_application_model = self.model._meta.get_field("jobapplication").related_model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Je pense que je trouve from itou.job_applications.models import JobApplication plus simple par rapport à aller chercher un accès via les _meta du modèle

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

En fait je suis resté iso avec ce qui est fait dans with_count_recent_received_job_apps dans le même fichier. Je vais regarder si on peut tout simplifier.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope :

ImportError: cannot import name 'CompanyMembership' from partially initialized module 'itou.companies.models' (most likely due to a circular import)

Bref je MEP tel quel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Je proposais de remettre ce qu'il y avait avant ta PR :
image
Tu importes le modèle directement ici

@dejafait
dejafait added this pull request to the merge queue Jun 30, 2025
Merged via the queue into master with commit 43282ef Jun 30, 2025
@dejafait
dejafait deleted the dejafait/change_search_badge_logic branch June 30, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants