Parcourir la source

Change some configuration for production server

Mohidul Islam il y a 4 ans
Parent
commit
77234acf26

+ 1 - 1
dashboard/views.py

@@ -79,7 +79,7 @@ class UnRepliedReviewList(LoginRequiredMixin, View):
         elif response.status_code in [500, 502, 503, 504]:
             messages.info(request, f'Something went wrong on Google\'s end. (These are rare.)')
         elif response.status_code == 501:
-            messages.info(request, f'This sevice is off/postpond on Google\'s end. (These are rare.)')
+            messages.info(request, f'This service is off/postpond on Google\'s end. (These are rare.)')
         else:
             messages.info(request, f'Something went wrong on Byte Trek end. (Notify the Devs)')
         return redirect('un-replied-review')

+ 6 - 6
review/background_job.py

@@ -62,21 +62,21 @@ def reply_uncommented_reviews():
 def send_email_bad_reviews():
     locations = Location.objects.all()
     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()
         if total_reviews > 0:
             to = settings.ADMIN_MAINTEINER_EMAILS
             # Add location mainteiner email if it has an email
             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'''
             <p>Hi there, </p>
             <p>There '''
             if total_reviews > 1:
-                tt = f'are {total_reviews} bad reviews has'
+                tt = f'are {total_reviews} negative reviews has'
             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>'
             for r in reviews:
                 # 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():
     populate_reviews()
     send_email_bad_reviews()
-    sleep(60 * random.randint(2, 5))
-    reply_uncommented_reviews()
+    # sleep(60 * random.randint(2, 5))
+    # reply_uncommented_reviews()

+ 1 - 1
review/review_utils.py

@@ -109,7 +109,7 @@ def sync_all_review(loc_id):
             break
 
 
-def fetch_last_20_reviews(loc_id, page_size=20):
+def fetch_last_20_reviews(loc_id, page_size=200):
     headers = get_auth_header()
     url = get_review_list_url(loc_id)+'&pageSize='+str(page_size)
     res = get(url, headers=headers)

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
review_automation.sql


+ 2 - 2
review_automation/settings/prod.py

@@ -3,7 +3,7 @@ from .base import *
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = False
 
-ALLOWED_HOSTS = ['10.0.0.36', 'bytetrek.com']
+ALLOWED_HOSTS = ['10.0.0.36', 'bytetrek.com', 'localhost']
 
 WSGI_APPLICATION = 'review_automation.wsgi.prod.application'
 
@@ -40,4 +40,4 @@ AUTH_PASSWORD_VALIDATORS = [
 # Host URLS
 
 HOST_URI = "http://10.0.0.36:5005"
-NLU_SERVER_URI = 'http://10.0.0.25:5005'
+NLU_SERVER_URI = 'http://localhost:1996'

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff