leadguru-jobs 0.570.0__py3-none-any.whl → 0.572.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: leadguru_jobs
3
- Version: 0.570.0
3
+ Version: 0.572.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -44,11 +44,11 @@ lgt_jobs/lgt_data/engine.py,sha256=Rsbz-CApAo_TVDssdjBkv8v_fVOZm_Uh1S6W4fnaEWo,7
44
44
  lgt_jobs/lgt_data/enums.py,sha256=jBH5WGBtDAvFrh4iiPIzlQ-XrImMpuwqstuasG55mJ0,2209
45
45
  lgt_jobs/lgt_data/helpers.py,sha256=NDa-V5EYaJfkGoWsmQSwSe6N_jxNxs8tHRQzW1iST6k,480
46
46
  lgt_jobs/lgt_data/model.py,sha256=BtVpJC_TRXUOklpzwRiDywyuKCCV2GGXtjsRYcPibDc,28454
47
- lgt_jobs/lgt_data/mongo_repository.py,sha256=zl-LgZ51GQah6tqhWNMjMt4VM5cyDqyX5F22HtT_Ns4,45293
47
+ lgt_jobs/lgt_data/mongo_repository.py,sha256=gRR4ZE0zluPIbl9G4N90lQ6OVhRreEaFCGO4BfGVyEY,45918
48
48
  lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  lgt_jobs/services/web_client.py,sha256=GLWsJkIC8rv6xLFaLwcMm4EwBlVDu0njORwkZqBJaE4,2086
50
50
  lgt_jobs/templates/new_message.html,sha256=BD_E90akmQ1Wf07wtZAjeK_7DUKRmja5HFHVo_AKI24,6994
51
- leadguru_jobs-0.570.0.dist-info/METADATA,sha256=XzdISPrTs7FOu0etBlaznFtlRg-qi819rgNuUTtpdPc,1319
52
- leadguru_jobs-0.570.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
53
- leadguru_jobs-0.570.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
54
- leadguru_jobs-0.570.0.dist-info/RECORD,,
51
+ leadguru_jobs-0.572.0.dist-info/METADATA,sha256=EewGqxujjN5YCXOYbWlwxKnUMYKwciGXOKW3mY8PEp0,1319
52
+ leadguru_jobs-0.572.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
53
+ leadguru_jobs-0.572.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
54
+ leadguru_jobs-0.572.0.dist-info/RECORD,,
@@ -65,9 +65,21 @@ class UserMongoRepository(BaseMongoRepository):
65
65
  update_dict = {k: v for k, v in kwargs.items() if v is not None}
66
66
  self.collection().update_one({'_id': to_object_id(_id)}, {'$set': update_dict})
67
67
 
68
- def get_users(self, users_ids=None, include_inactive=False):
68
+ def get_users(self, users_ids=None, include_inactive=False, **kwargs):
69
69
  pipeline = {}
70
70
 
71
+ subscription_expired = kwargs.get('subscription_expired')
72
+ soon_subscription_expiration = kwargs.get('soon_subscription_expiration')
73
+ min_days = kwargs.get('min_days_soon_subscription_expiration', 3)
74
+
75
+ if subscription_expired:
76
+ pipeline['subscription_expired_at'] = {'$lte': datetime.now(UTC)}
77
+ pipeline['subscription_expiration_notified'] = False
78
+
79
+ if soon_subscription_expiration:
80
+ pipeline['subscription_expired_at'] = {'$lte': datetime.now(UTC) + timedelta(min_days)}
81
+ pipeline['subscription_expiration_warning_notified'] = False
82
+
71
83
  if users_ids is not None:
72
84
  pipeline['_id'] = {'$in': [to_object_id(_id) for _id in users_ids]}
73
85