@@ -82,21 +82,24 @@ def process_subscription_fulfillments():
82
82
def check_shipping_updates ():
83
83
with Transaction () as t :
84
84
pfr = PerkFulfillmentRepo (t )
85
- emails_sent , error_report = pfr .check_for_shipping_updates ()
85
+ pf_active = pfr .check_perk_fulfillment_active ()
86
86
87
- if emails_sent > 0 or len ( error_report ) > 0 :
88
- t . commit ()
87
+ if pf_active :
88
+ emails_sent , error_report = pfr . check_for_shipping_updates ()
89
89
90
- email_content = f"Emails sent: { emails_sent } \n " \
91
- f"Errors: { error_report } "
92
- try :
93
- send_email (SERVER_CONFIG ['pester_email' ], "pester_daniel" ,
94
- {"what" : "Automated Tracking Updates Output" ,
95
- "content" : email_content },
96
- EN_US )
97
- except : # noqa
98
- # try our best to email
99
- pass
90
+ if emails_sent > 0 or len (error_report ) > 0 :
91
+ t .commit ()
92
+
93
+ email_content = f"Emails sent: { emails_sent } \n " \
94
+ f"Errors: { error_report } "
95
+ try :
96
+ send_email (SERVER_CONFIG ['pester_email' ], "pester_daniel" ,
97
+ {"what" : "Automated Tracking Updates Output" ,
98
+ "content" : email_content },
99
+ EN_US )
100
+ except : # noqa
101
+ # try our best to email
102
+ pass
100
103
101
104
102
105
@celery .task (ignore_result = True )
0 commit comments