leadguru-jobs 0.574.0__py3-none-any.whl → 0.575.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.574.0
3
+ Version: 0.575.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -43,12 +43,12 @@ lgt_jobs/lgt_data/analytics.py,sha256=TFUffL8Dn-vIJ3ZaCVN-cj1Qnjb8F9GJyuk6Fo7mR1
43
43
  lgt_jobs/lgt_data/engine.py,sha256=Rsbz-CApAo_TVDssdjBkv8v_fVOZm_Uh1S6W4fnaEWo,7728
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
- lgt_jobs/lgt_data/model.py,sha256=BtVpJC_TRXUOklpzwRiDywyuKCCV2GGXtjsRYcPibDc,28454
47
- lgt_jobs/lgt_data/mongo_repository.py,sha256=0eicwUtDRZj4TRanFHjgiM09WIGcVT1rpPFbZ7E_0Xs,45930
46
+ lgt_jobs/lgt_data/model.py,sha256=QAWnCPHEoNdXaPPCgMi_tHLx11zj0xcGUUUg2CDS3DQ,28554
47
+ lgt_jobs/lgt_data/mongo_repository.py,sha256=kLE906lfqhHF9gp1qvH_3XKCZGCZnxjLMrBLWBy7doo,46099
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.574.0.dist-info/METADATA,sha256=UdGX5jfKSKmarU6YO8Urd4amCXBlQp5wu7LANjFW-Rc,1319
52
- leadguru_jobs-0.574.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
53
- leadguru_jobs-0.574.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
54
- leadguru_jobs-0.574.0.dist-info/RECORD,,
51
+ leadguru_jobs-0.575.0.dist-info/METADATA,sha256=7-uevLVGuTrD3JWEaQOM0IZubGdCDAnFA9r4yBfySnE,1319
52
+ leadguru_jobs-0.575.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
53
+ leadguru_jobs-0.575.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
54
+ leadguru_jobs-0.575.0.dist-info/RECORD,,
@@ -327,13 +327,13 @@ class UserModel(BaseModel):
327
327
  return self.subscription_expired_at.replace(tzinfo=UTC) < datetime.now(UTC)
328
328
 
329
329
  def get_slack_user(self, slack_email: str):
330
- return next(filter(lambda x: slack_email == x.email, self.slack_users), None)
330
+ return next(filter(lambda x: slack_email == x.email and not x.deleted, self.slack_users), None)
331
331
 
332
332
  def get_discord_user(self, login: str):
333
- return next(filter(lambda x: login == x.login, self.discord_users), None)
333
+ return next(filter(lambda x: login == x.login and not x.deleted, self.discord_users), None)
334
334
 
335
335
 
336
- class DiscordUser(BaseModel):
336
+ class DiscordUser(DictionaryModel):
337
337
  pass
338
338
 
339
339
  def __init__(self):
@@ -343,6 +343,7 @@ class DiscordUser(BaseModel):
343
343
  self.captcha_key = ''
344
344
  self.status = None
345
345
  self.workspaces: List[UserWorkspace] = []
346
+ self.deleted = False
346
347
 
347
348
  def to_dic(self):
348
349
  result = copy.deepcopy(self.__dict__)
@@ -374,6 +375,7 @@ class SlackUser:
374
375
  self.email = ''
375
376
  self.status = None
376
377
  self.workspaces: List[UserWorkspace] = []
378
+ self.deleted = False
377
379
 
378
380
  def to_dic(self):
379
381
  result = copy.deepcopy(self.__dict__)
@@ -69,6 +69,7 @@ class UserMongoRepository(BaseMongoRepository):
69
69
  pipeline = {}
70
70
 
71
71
  subscription_expired = kwargs.get('subscription_expired')
72
+ connected_slack_email = kwargs.get('connected_slack_email')
72
73
  soon_subscription_expiration = kwargs.get('soon_subscription_expiration')
73
74
  min_days = kwargs.get('min_days_soon_subscription_expiration', 3)
74
75
 
@@ -80,6 +81,9 @@ class UserMongoRepository(BaseMongoRepository):
80
81
  pipeline['subscription_expired_at'] = {'$lte': datetime.now(UTC) + timedelta(min_days)}
81
82
  pipeline['subscription_expiration_warning_notified'] = False
82
83
 
84
+ if connected_slack_email:
85
+ pipeline['slack_users.email'] = connected_slack_email
86
+
83
87
  if users_ids is not None:
84
88
  pipeline['_id'] = {'$in': [to_object_id(_id) for _id in users_ids]}
85
89