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

chore: Revert "fix: add unique constraint in task_logs for expense_group, add interval for next run (#690)" #693

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions apps/tasks/migrations/0012_alter_tasklog_expense_group.py

This file was deleted.

2 changes: 1 addition & 1 deletion apps/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TaskLog(models.Model):
workspace = models.ForeignKey(Workspace, on_delete=models.PROTECT, help_text='Reference to Workspace model')
type = models.CharField(max_length=50, help_text='Task type (FETCH_EXPENSES / CREATE_BILL / CREATE_CHECK)')
task_id = models.CharField(max_length=255, null=True, help_text='Django Q task reference')
expense_group = models.ForeignKey(ExpenseGroup, on_delete=models.PROTECT, null=True, help_text='Reference to Expense group', unique=True)
expense_group = models.ForeignKey(ExpenseGroup, on_delete=models.PROTECT, null=True, help_text='Reference to Expense group')
bill = models.ForeignKey(Bill, on_delete=models.PROTECT, help_text='Reference to Bill', null=True)
cheque = models.ForeignKey(Cheque, on_delete=models.PROTECT, help_text='Reference to Cheque', null=True)
journal_entry = models.ForeignKey(JournalEntry, on_delete=models.PROTECT, help_text='Reference to journal_entry', null=True)
Expand Down
3 changes: 1 addition & 2 deletions apps/workspaces/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ def schedule_sync(workspace_id: int, schedule_enabled: bool, hours: int, email_a
'schedule_type': Schedule.MINUTES,
'minutes': hours * 60,
'next_run': datetime.now() + timedelta(hours=hours),
}
)
})

ws_schedule.schedule = schedule

Expand Down
Loading