kopia lustrzana https://github.com/HackerspaceWroclaw/wlokalu
Fixed dying when a person was already in premises.
rodzic
101f5d28b5
commit
fca4585335
|
@ -11,7 +11,8 @@ from models import Person
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
def person_enter(nick):
|
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):
|
def person_leave(nick):
|
||||||
Person(nick).delete()
|
Person(nick).delete()
|
||||||
|
|
Ładowanie…
Reference in New Issue