Browse Source

FIX colore e add

boyska 4 years ago
parent
commit
1e1a446655
2 changed files with 3 additions and 3 deletions
  1. 2 2
      rxmap/rxmapp/models.py
  2. 1 1
      rxmap/rxmapp/views.py

+ 2 - 2
rxmap/rxmapp/models.py

@@ -52,9 +52,9 @@ class RapportoRicezione(models.Model):
 
     @property
     def colore(self):
-        colors = ['red', 'yellow', 'orange', '#90c90d', 'green']
+        colors = ['darkred', 'red', 'yellow', 'orange', '#90c90d', 'green']
         c = int(self.comprensibile)
-        return colors[c-1]
+        return colors[c]
 
     @property
     def radius(self):

+ 1 - 1
rxmap/rxmapp/views.py

@@ -33,7 +33,7 @@ def rapporto_add(request):
         lat=float(request.POST["lat"]),
         lng=float(request.POST["lng"]),
         comprensibile=int(request.POST["comprensibile"]),
-        stabilita=int(request.POST["comprensibile"]),
+        stabilita=int(request.POST["stabilita"]),
         tipo_radio=TipoRadio.objects.get(pk=request.POST["tiporadio"]),
     )
     r.save()