From 1b736e23ab446e754b0aaadee6faf01db46a9a2a Mon Sep 17 00:00:00 2001 From: bashmak Date: Fri, 22 Jun 2018 11:17:27 +0300 Subject: [PATCH] Fix bugs --- abonapp/views.py | 9 ++++++- .../templates/clientsideapp/ext.html | 24 +++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/abonapp/views.py b/abonapp/views.py index afd4b72..4dc5db4 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -1,6 +1,6 @@ from typing import Dict, Optional from django.contrib.gis.shortcuts import render_to_text -from django.core.exceptions import PermissionDenied +from django.core.exceptions import PermissionDenied, ValidationError from django.db import IntegrityError, ProgrammingError, transaction from django.db.models import Count, Q from django.shortcuts import render, redirect, get_object_or_404, resolve_url @@ -1097,6 +1097,13 @@ class EditSibscriberMarkers(UpdateView): obj = models.Abon.objects.get(username=self.kwargs.get('uname')) return obj + def dispatch(self, request, *args, **kwargs): + try: + return super(EditSibscriberMarkers, self).dispatch(request, *args, **kwargs) + except ValidationError as e: + messages.error(request, e) + return self.render_to_response(self.get_context_data()) + def get_success_url(self): return resolve_url('abonapp:abon_home', self.kwargs.get('gid'), self.kwargs.get('uname')) diff --git a/clientsideapp/templates/clientsideapp/ext.html b/clientsideapp/templates/clientsideapp/ext.html index 4105265..305d090 100644 --- a/clientsideapp/templates/clientsideapp/ext.html +++ b/clientsideapp/templates/clientsideapp/ext.html @@ -51,18 +51,18 @@ {% trans 'Services' %} - +{# #}