diff --git a/rental/bookings.py b/rental/bookings.py index 8922212..532f3d9 100644 --- a/rental/bookings.py +++ b/rental/bookings.py @@ -1,14 +1,13 @@ -import datetime from rental.pricing import get_reservation_price from django.shortcuts import get_object_or_404 from rental.models import Reservation, Place, Guest +from villafleurie.settings import BASE_DIR import datetime from google.auth.transport.requests import Request from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build import os.path import pickle -from villafleurie.settings import BASE_DIR def build_calendar_api_service(): @@ -151,3 +150,7 @@ def update_calendar(reservation): }, } ).execute() + + +if __name__ == '__main__': + s, c = build_calendar_api_service() diff --git a/rental/tasks/apiMailer.py b/rental/tasks/apiMailer.py index 2fc6703..716074e 100644 --- a/rental/tasks/apiMailer.py +++ b/rental/tasks/apiMailer.py @@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals from celery import shared_task from villafleurie.settings import EMAIL_HOST_USER, DEFAULT_FROM_EMAIL import requests +from datetime import datetime """ Mailer Service used to send messages using API WebHooks. All Mailers must implement the following methods: @@ -51,4 +52,13 @@ def send_notification(name, email, subject, message, date): @shared_task def send_quotation(name, email): """ Send quotation to customer """ + + send_notification( + name, + email, + "Nouvelle demande de réservation", + "Depuis le site", + datetime.now() + ) + send_confirmation(name, email) diff --git a/rental/templates/rental/base.html b/rental/templates/rental/base.html index e5fced0..508c025 100644 --- a/rental/templates/rental/base.html +++ b/rental/templates/rental/base.html @@ -4,6 +4,10 @@
+