diff --git a/README.md b/README.md index e290c13..1cea4f5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.org/fhinkel/create-download-link.svg?branch=master)](https://travis-ci.org/fhinkel/create-download-link) - # Villafleurie : moteur de réservation autonome `V 0.1 Le site est structuré. Il reste à appliquer le contenu et les visuels` @@ -116,6 +114,7 @@ Le visiteur doit pouvoir : - Centrer Bouton "Reserver" page location - Ajouter un titre "Disponibilités" au dessus du calendrier - page réservation/services : égayer avec des petites photos … +- Internationalisation ## BUGS diff --git a/rental/bookings.py b/rental/bookings.py index dd6af9b..73042f8 100644 --- a/rental/bookings.py +++ b/rental/bookings.py @@ -138,10 +138,23 @@ def update_calendar(reservation): # authenticate and build service # event.insert(calendarId, summary="Guest", description="Message", end, start ) service, calendars = build_calendar_api_service() + start = reservation.start.strftime('%Y-%m-%d') + end = reservation.end.strftime('%Y-%m-%d') + service.events().insert( calendarId=calendars[reservation.place.name], - summary=reservation.guest.name, - description=reservation.message, - end=reservation.end, - start=reservation.start + body={ + "summary": reservation.guest.name, + "description": reservation.message, + "start": { + "date": start + }, + "end": { + "date": end + }, + } ) + + +if __name__ == "__main__": + update_calendar(reservation)