fix formularza klienta
This commit is contained in:
parent
3d4a87e629
commit
570463a30b
BIN
hotel/db.sqlite3
BIN
hotel/db.sqlite3
Binary file not shown.
Binary file not shown.
@ -48,7 +48,8 @@ def reservation(request):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
begin = datetime.datetime.strptime(begin_date, "%d-%m-%Y")
|
||||||
|
end = datetime.datetime.strptime(end_date, "%d-%m-%Y")
|
||||||
try:
|
try:
|
||||||
client_id = request.POST['id_number']
|
client_id = request.POST['id_number']
|
||||||
|
|
||||||
@ -66,11 +67,12 @@ def reservation(request):
|
|||||||
r = Reservation()
|
r = Reservation()
|
||||||
r.room_number = get_object_or_404(Room, room_number=room_number)
|
r.room_number = get_object_or_404(Room, room_number=room_number)
|
||||||
r.client_id = get_object_or_404(Client, id_number=client_id)
|
r.client_id = get_object_or_404(Client, id_number=client_id)
|
||||||
r.begin_date = begin_date
|
r.begin_date = begin
|
||||||
r.end_date = end_date
|
r.end_date = end
|
||||||
r.save()
|
r.save()
|
||||||
|
|
||||||
status = "Pokój " + str(room_number) + " został pomyślnie zarezerwowany"
|
status = "Pokój " + str(room_number) + " został pomyślnie zarezerwowany"
|
||||||
|
|
||||||
return HttpResponse(template.render({'status': status}, request))
|
return HttpResponse(template.render({'status': status}, request))
|
||||||
else:
|
else:
|
||||||
error = "Zły numer dowodu"
|
error = "Zły numer dowodu"
|
||||||
|
Loading…
Reference in New Issue
Block a user