mirror of
https://github.com/rjNemo/villafleurie
synced 2026-06-12 13:26:47 +00:00
fix reservation bug
This commit is contained in:
parent
bab9832e20
commit
9595ce71b5
2 changed files with 7 additions and 13 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
import pickle
|
import pickle
|
||||||
|
|
||||||
from google.auth.transport.requests import Request
|
from google.auth.transport.requests import Request
|
||||||
from google_auth_oauthlib.flow import InstalledAppFlow, Flow
|
from google_auth_oauthlib.flow import InstalledAppFlow, Flow
|
||||||
from googleapiclient.discovery import build
|
from googleapiclient.discovery import build
|
||||||
|
|
@ -58,9 +59,9 @@ def get_bookings(place):
|
||||||
orderBy='startTime'
|
orderBy='startTime'
|
||||||
).execute()
|
).execute()
|
||||||
events = events_result.get('items', [])
|
events = events_result.get('items', [])
|
||||||
|
|
||||||
if not events:
|
if not events:
|
||||||
print('No upcoming events found.')
|
logging.info('No upcoming events found.')
|
||||||
|
reservation = None
|
||||||
else:
|
else:
|
||||||
for event in events:
|
for event in events:
|
||||||
reservation = {
|
reservation = {
|
||||||
|
|
@ -79,6 +80,8 @@ def synchronize(place):
|
||||||
Delete from db reservation deleted from cal """
|
Delete from db reservation deleted from cal """
|
||||||
|
|
||||||
reservation = get_bookings(place)
|
reservation = get_bookings(place)
|
||||||
|
if not reservation:
|
||||||
|
return
|
||||||
place = get_object_or_404(m_place.Place, name=place.name)
|
place = get_object_or_404(m_place.Place, name=place.name)
|
||||||
|
|
||||||
start = reservation['start']
|
start = reservation['start']
|
||||||
|
|
|
||||||
|
|
@ -49,16 +49,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 section-t8">
|
<div class="col-sm-12 section-t8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-7">
|
|
||||||
<form class="form-a" action="" method="post" role="form">
|
|
||||||
<!-- <div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
{% csrf_token %} {{ form.as_p }}
|
|
||||||
<button type="submit" class="btn btn-a">Envoyer</button>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-5 section-md-t3">
|
<div class="col-md-5 section-md-t3">
|
||||||
<div class="icon-box section-b2">
|
<div class="icon-box section-b2">
|
||||||
<div class="icon-box-icon">
|
<div class="icon-box-icon">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue