-
Notifications
You must be signed in to change notification settings - Fork 10
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
Affiche, appro : option pour dépublier diagnostics non-TDés #3913
Conversation
…iagnostics" This reverts commit 166cbf5.
…ield on full_clean by adding blank property
…llow for redaction
…d their own data for another year
…iagnostics with appro and service diagnostics
…ic preview serializer
return self.service_diagnostics | ||
|
||
@property | ||
def latest_published_year(self): |
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.
(Pas obligatoire)... Je me demande si on pouvait le rendre plus transparent en utilisant max
🤔
@property
def latest_published_year(self):
if not self.published_appro_diagnostics and not self.published_service_diagnostics:
return None
max_appro_year = self.published_appro_diagnostics.only("year").order_by("-year").first().year if self.published_appro_diagnostics else 0
max_service_year = self.published_service_diagnostics.only("year").order_by("-year").first().year if self.published_service_diagnostics else 0
return max(max_appro_year, max_service_year)
if not max_year or year > max_year: | ||
max_year = year | ||
return max_year | ||
|
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.
À voir après, mais si l'année est différente pour published_appro_diagnostics
et latest_published_service_diagnostic
, une de ces deux properties retournera None
même s'il y a un diagnostic derrière. C'est peut-être voulu ?
Par ex, imaginons que
self.published_appro_diagnostics.only("year").order_by("-year").first().year
est égal à 2024, etself.published_service_diagnostics.only("year").order_by("-year").first().year
est égal à 2021
Donc, latest_published_year
sera égal à 2024.
latest_published_appro_diagnostic
retournera bien un diagnostic, maislatest_published_service_diagnostic
retourneraNone
, et non pas le dernier diagnostic service de 2021
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.
Alors je l'ai fait comme ça surtout pour les badges, pour qu'on montre toujours les badges pour la même année. Ça me paraît le plus simple à comprendre, tu penses quoi ? Peut-être c'est un problème du nom de variable plutôt de comportement aussi.
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.
En vrai, entre ce commentaire et le commentaire perf, peut-être c'est mieux de faire comme tu proposes en premier temps, vu que le cas où les deux sont en décalage est rare.
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.
Moi ça me va de rester comme tu l'as fait, je voulais juste comprendre si c'était voulu ou non
frontend/src/components/CanteenPublication/ResultsComponents/QualityMeasureResults.vue
Outdated
Show resolved
Hide resolved
frontend/src/components/CanteenPublication/ResultsComponents/QualityMeasureResults.vue
Show resolved
Hide resolved
frontend/src/components/CanteenPublication/ResultsComponents/QualityMeasureResults.vue
Show resolved
Hide resolved
Co-authored-by: Alejandro M Guillén <alejandro@amguillen.dev>
…ualityMeasureResults.vue Co-authored-by: Alejandro M Guillén <alejandro@amguillen.dev>
en deuxieme temps : p-e au lieu de |
closes #3888
les parties de cette PR:
redacted_appro_years
rappel des règles fonctionnelles existantes:
règles fonctionnelles créées par cette PR:
les views a tester sur le front:
les configurations a tester:
Later:
Complete tests of new badges backend logic. Consider removing applicableDiagnosticRules from the frontend
todo: