From c63a7d5fa404213ea401bcb62856c6c579c2995d Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 10 Mar 2016 12:18:30 +0100 Subject: [PATCH] Avoid duplicated backups. --- auto_backup/models/db_backup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/auto_backup/models/db_backup.py b/auto_backup/models/db_backup.py index 9b8b6d921..7131530b9 100644 --- a/auto_backup/models/db_backup.py +++ b/auto_backup/models/db_backup.py @@ -26,6 +26,7 @@ class DbBackup(models.Model): _inherit = "mail.thread" _sql_constraints = [ + ("name_unique", "UNIQUE(name)", "Cannot duplicate a configuration."), ("days_to_keep_positive", "CHECK(days_to_keep >= 0)", "I cannot remove backups from the future. Ask Doc for that."), ]