|
@@ -62,21 +62,21 @@ def reply_uncommented_reviews():
|
|
def send_email_bad_reviews():
|
|
def send_email_bad_reviews():
|
|
locations = Location.objects.all()
|
|
locations = Location.objects.all()
|
|
for location in locations:
|
|
for location in locations:
|
|
- reviews = get_bad_reviews(location.location_id, hours=6)
|
|
|
|
|
|
+ reviews = get_bad_reviews(location.location_id, hours=1)
|
|
total_reviews = reviews.count()
|
|
total_reviews = reviews.count()
|
|
if total_reviews > 0:
|
|
if total_reviews > 0:
|
|
to = settings.ADMIN_MAINTEINER_EMAILS
|
|
to = settings.ADMIN_MAINTEINER_EMAILS
|
|
# Add location mainteiner email if it has an email
|
|
# Add location mainteiner email if it has an email
|
|
to.append(location.recipient_email) if location.recipient_email else None
|
|
to.append(location.recipient_email) if location.recipient_email else None
|
|
|
|
|
|
- subject = f"A bad review has been post in {location.care_name}."
|
|
|
|
|
|
+ subject = f"A negative review has been post in {location.care_name}."
|
|
message = f'''
|
|
message = f'''
|
|
<p>Hi there, </p>
|
|
<p>Hi there, </p>
|
|
<p>There '''
|
|
<p>There '''
|
|
if total_reviews > 1:
|
|
if total_reviews > 1:
|
|
- tt = f'are {total_reviews} bad reviews has'
|
|
|
|
|
|
+ tt = f'are {total_reviews} negative reviews has'
|
|
else:
|
|
else:
|
|
- tt = f'is a bad review has '
|
|
|
|
|
|
+ tt = f'is a negative review has '
|
|
message += tt + f'been posted in {location.care_name}.</p>'
|
|
message += tt + f'been posted in {location.care_name}.</p>'
|
|
for r in reviews:
|
|
for r in reviews:
|
|
# link = r.location.review_site_url + '?reviewId='+r.review_id
|
|
# link = r.location.review_site_url + '?reviewId='+r.review_id
|
|
@@ -92,5 +92,5 @@ def send_email_bad_reviews():
|
|
def background_task_6_hours_interval():
|
|
def background_task_6_hours_interval():
|
|
populate_reviews()
|
|
populate_reviews()
|
|
send_email_bad_reviews()
|
|
send_email_bad_reviews()
|
|
- sleep(60 * random.randint(2, 5))
|
|
|
|
- reply_uncommented_reviews()
|
|
|
|
|
|
+ # sleep(60 * random.randint(2, 5))
|
|
|
|
+ # reply_uncommented_reviews()
|