fix: add filter to query to avoid send reminder for zero years (#28092) (#28096)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit 8cad23b8fb4d830a5703e107c371ae9319bc003d)

Co-authored-by: gsi-maruiz <62341390+gsi-maruiz@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2021-10-27 11:21:26 +05:30 committed by GitHub
parent 2920f2f614
commit 25d1c1ce86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,6 +156,8 @@ def get_employees_having_an_event_today(event_type):
DAY({condition_column}) = DAY(%(today)s)
AND
MONTH({condition_column}) = MONTH(%(today)s)
AND
YEAR({condition_column}) < YEAR(%(today)s)
AND
`status` = 'Active'
""",
@ -166,6 +168,8 @@ def get_employees_having_an_event_today(event_type):
DATE_PART('day', {condition_column}) = date_part('day', %(today)s)
AND
DATE_PART('month', {condition_column}) = date_part('month', %(today)s)
AND
DATE_PART('year', {condition_column}) < date_part('year', %(today)s)
AND
"status" = 'Active'
""",