diff options
Diffstat (limited to 'src/account')
-rw-r--r-- | src/account/models.py | 6 | ||||
-rw-r--r-- | src/account/views.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/account/models.py b/src/account/models.py index bfeead0..0f8154e 100644 --- a/src/account/models.py +++ b/src/account/models.py @@ -94,7 +94,7 @@ class VlanManager(models.Model): vlan_master_list = json.loads(self.vlans) try: iter(vlans) - except: + except Exception: vlans = [vlans] for vlan in vlans: @@ -112,7 +112,7 @@ class VlanManager(models.Model): try: iter(vlans) - except: + except Exception: vlans = [vlans] for vlan in vlans: @@ -125,7 +125,7 @@ class VlanManager(models.Model): try: iter(vlans) - except: + except Exception: vlans = [vlans] vlans = set(vlans) diff --git a/src/account/views.py b/src/account/views.py index 09c5266..e880208 100644 --- a/src/account/views.py +++ b/src/account/views.py @@ -181,8 +181,8 @@ def account_booking_view(request): if not request.user.is_authenticated: return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) template = "account/booking_list.html" - bookings = list(Booking.objects.filter(owner=request.user)) - collab_bookings = list(request.user.collaborators.all()) + bookings = list(Booking.objects.filter(owner=request.user).order_by("-start")) + collab_bookings = list(request.user.collaborators.all().order_by("-start")) context = {"title": "My Bookings", "bookings": bookings, "collab_bookings": collab_bookings} return render(request, template, context=context) |