diff --git a/tariff_app/locale/ru/LC_MESSAGES/django.po b/tariff_app/locale/ru/LC_MESSAGES/django.po index 3c8b803..72211d2 100644 --- a/tariff_app/locale/ru/LC_MESSAGES/django.po +++ b/tariff_app/locale/ru/LC_MESSAGES/django.po @@ -215,3 +215,6 @@ msgstr "Вы уверены что хотите удалить тариф?" msgid "IS Daily service" msgstr "Услуга на сутки" + +msgid "Service with this Speed In, Speed Out, Price and Script already exists." +msgstr "Услуга с такой скоростью, ценой и логикой уже есть" diff --git a/tariff_app/models.py b/tariff_app/models.py index 6ca5e04..1698403 100644 --- a/tariff_app/models.py +++ b/tariff_app/models.py @@ -54,6 +54,7 @@ class Tariff(models.Model): ordering = ('title',) verbose_name = _('Service') verbose_name_plural = _('Services') + unique_together = ('speedIn', 'speedOut', 'amount', 'calc_type') class PeriodicPay(models.Model): diff --git a/tariff_app/templates/tariff_app/editTarif.html b/tariff_app/templates/tariff_app/editTarif.html index d151da0..8be8cd1 100644 --- a/tariff_app/templates/tariff_app/editTarif.html +++ b/tariff_app/templates/tariff_app/editTarif.html @@ -24,6 +24,8 @@