Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IntegrityError when creating periodic tasks
Change PeriodicTask.objects.get_or_create() to PeriodicTask.objects.update_or_create(). This change prevents a potential IntegrityError when creating a periodic task due to duplicate primary key. By using update_or_create, if the record already exists, it will be updated instead of attempting to insert a new record with the same primary key, ensuring the process completes without error.
- Loading branch information