-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved the email notification logic to a seperate schedule (#183)
* Moved the email notification logic to a seperate schedule * Moved the email notification logic to a seperate schedule and bug fix related to sync_schedule * fixed tests settings bug * Typo fix * Added sql script and modified django query
- Loading branch information
1 parent
6ec811c
commit 6f459dc
Showing
8 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -43,6 +43,7 @@ | |
'rest_framework', | ||
'fyle_rest_auth', | ||
'django_filters', | ||
'django_q', | ||
|
||
# User Created Apps | ||
'apps.users', | ||
|
This file contains 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,9 @@ | ||
from django.db.models.signals import post_save | ||
from django.dispatch import receiver | ||
from apps.bamboohr.models import BambooHrConfiguration | ||
from apps.bamboohr.tasks import schedule_sync_employees | ||
|
||
|
||
@receiver(post_save, sender=BambooHrConfiguration) | ||
def run_post_save_configurations(sender, instance: BambooHrConfiguration, *args, **kwargs): | ||
schedule_sync_employees(org_id=instance.org.id) |
This file contains 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 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
18 changes: 18 additions & 0 deletions
18
apps/fyle_hrms_mappings/migrations/0005_destinationattribute_is_failure_email_sent.py
This file contains 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,18 @@ | ||
# Generated by Django 3.1.14 on 2024-02-19 10:14 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('fyle_hrms_mappings', '0004_mapping'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='destinationattribute', | ||
name='is_failure_email_sent', | ||
field=models.BooleanField(default=False, help_text='Indicates whether the failure email is sent'), | ||
), | ||
] |
This file contains 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 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
6 changes: 6 additions & 0 deletions
6
scripts/sql/002-update-email-sent-field-in-destination-attributes.sql
This file contains 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 @@ | ||
rollback; | ||
begin; | ||
|
||
update destination_attributes | ||
set is_failure_email_sent = true | ||
where detail->>'email' is null; |