@@ -1273,11 +1273,20 @@ def can_allocate(self, number_of_learners, content_key, content_price_cents):
1273
1273
1274
1274
# Use all of these pieces to ensure that the assignments to potentially
1275
1275
# allocate won't exceed the remaining balance of the related subsidy.
1276
+ subsidy_balance = self .subsidy_balance ()
1276
1277
if self .content_would_exceed_limit (
1277
1278
total_allocated_and_spent_cents ,
1278
- self . subsidy_balance () ,
1279
+ subsidy_balance ,
1279
1280
positive_total_price_cents ,
1280
1281
):
1282
+ logger .info (
1283
+ f'content_would_exceed_limit function: '
1284
+ f'subsidy_uuid={ self .subsidy_uuid } , '
1285
+ f'policy_uuid={ self .uuid } ,'
1286
+ f'total_allocated_and_spent_centers={ total_allocated_and_spent_cents } , '
1287
+ f'subsidy_balance={ subsidy_balance } , '
1288
+ f'positive_total_price_cents={ positive_total_price_cents } , '
1289
+ )
1281
1290
return (False , REASON_NOT_ENOUGH_VALUE_IN_SUBSIDY )
1282
1291
1283
1292
# Lastly, use all of these pieces to ensure that the assignments to potentially
@@ -1287,6 +1296,14 @@ def can_allocate(self, number_of_learners, content_key, content_price_cents):
1287
1296
self .spend_limit ,
1288
1297
positive_total_price_cents ,
1289
1298
):
1299
+ logger .info (
1300
+ f'content_would_exceed_limit function: '
1301
+ f'subsidy_uuid={ self .subsidy_uuid } , '
1302
+ f'policy_uuid={ self .uuid } , '
1303
+ f'total_allocated_and_spent_centers={ total_allocated_and_spent_cents } , '
1304
+ f'spend_limit={ self .spend_limit } , '
1305
+ f'positive_total_price_cents={ positive_total_price_cents } , '
1306
+ )
1290
1307
return (False , REASON_POLICY_SPEND_LIMIT_REACHED )
1291
1308
1292
1309
return (True , None )
0 commit comments