From fca458533558efc1a0f3fa7c10a9ea2dff2170e3 Mon Sep 17 00:00:00 2001 From: Stanislaw Klekot Date: Sun, 8 Jun 2014 00:06:38 +0200 Subject: [PATCH] Fixed dying when a person was already in premises. --- wlokalu/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlokalu/views.py b/wlokalu/views.py index 21af15f..e2ab0b1 100644 --- a/wlokalu/views.py +++ b/wlokalu/views.py @@ -11,7 +11,8 @@ from models import Person #----------------------------------------------------------------------------- def person_enter(nick): - Person(nick).save() + if Person.objects.filter(nick = nick).count() == 0: + Person(nick).save() # add if not exists def person_leave(nick): Person(nick).delete()