leadguru-jobs 0.400.0__py3-none-any.whl → 0.402.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.400.0
3
+ Version: 0.402.0
4
4
  Summary: LGT jobs builds
5
5
  Author-email: developer@leadguru.co
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -38,12 +38,12 @@ lgt_jobs/lgt_data/analytics.py,sha256=qo5nNFQxOTTk8i3tmCq0d3F9iaV9MTIR84SSi6uNrJ
38
38
  lgt_jobs/lgt_data/engine.py,sha256=iTcLvU7QZvB14hcERQrxSql9cVEcMEzu_tUcWD2Z24A,8076
39
39
  lgt_jobs/lgt_data/enums.py,sha256=A5nWwBgTVW7XaqL30NHNmO0SG_yeDk1dI-U5xrgU2zg,1552
40
40
  lgt_jobs/lgt_data/helpers.py,sha256=58ycqKF1z5nAw0vs6yVCg-SQet107YHyKYXaQUc7M68,157
41
- lgt_jobs/lgt_data/model.py,sha256=cdQpVTIB3FmFg1rcS3dbkkdjj1WhhTBDB9lfI_sVSHM,27584
42
- lgt_jobs/lgt_data/mongo_repository.py,sha256=rcfXaXdUWdLo9n8R7JElP_RIF-6UUHkUPPAoNWa3FRw,35928
41
+ lgt_jobs/lgt_data/model.py,sha256=jK3jBpp2sHkoV2XKoBChKjAjWhtp_6eQra3_RnD6Adg,28356
42
+ lgt_jobs/lgt_data/mongo_repository.py,sha256=tn_G-ZVOiQXanQ_L7dYeh7ftg6KK1ngyMRhMOrZq-ho,36012
43
43
  lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
44
  lgt_jobs/services/web_client.py,sha256=D3y5KVVBk7mesRnsiByx4tFmNbfTOKOUoIp3VCHuk0I,1983
45
45
  lgt_jobs/templates/new_message_mail_template.html,sha256=82XdDPtmkJVUWUcZtgd8bv_9-viAG2WWOnf3AhR6PeY,3635
46
- leadguru_jobs-0.400.0.dist-info/METADATA,sha256=LHdKdO1BBOT72QTK1MQAD5adFXsJQNcC5uC3KuSvkG0,1296
47
- leadguru_jobs-0.400.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
48
- leadguru_jobs-0.400.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
49
- leadguru_jobs-0.400.0.dist-info/RECORD,,
46
+ leadguru_jobs-0.402.0.dist-info/METADATA,sha256=nwV7-rTXNjJxZmtMmjck9b0PUlBdxwDZaUQOaKNOzgU,1296
47
+ leadguru_jobs-0.402.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
48
+ leadguru_jobs-0.402.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
49
+ leadguru_jobs-0.402.0.dist-info/RECORD,,
@@ -492,6 +492,7 @@ class ExtendedLeadModel(LeadModel):
492
492
  self.deleted = False
493
493
  self.user_lead: UserLeadModel | None = None
494
494
  self.dedicated: bool = False
495
+ self.bots: List[BotInfo] = []
495
496
 
496
497
  @classmethod
497
498
  def from_dic(cls, dic: dict):
@@ -507,6 +508,7 @@ class ExtendedLeadModel(LeadModel):
507
508
  result.user_lead = UserLeadModel.from_dic(dic.get('user_lead'))
508
509
  result.last_conversation = [SlackHistoryMessageModel.from_dic(message)
509
510
  for message in dic.get('last_conversation', [])]
511
+ result.bots = [BotInfo.from_dic(bot) for bot in dic.get('bots', [])]
510
512
  return result
511
513
 
512
514
  def to_csv(self, board_name: str) -> List[str]:
@@ -516,6 +518,35 @@ class ExtendedLeadModel(LeadModel):
516
518
  self.message.message.replace('\n', ' ').strip()]
517
519
 
518
520
 
521
+ class BotInfo:
522
+ def __init__(self):
523
+ self.id = None
524
+ self.invalid_creds: bool | None = False
525
+ self.source = None
526
+ self.banned: bool | None
527
+ self.user_name: str = ''
528
+ self.associated_user: str | None
529
+
530
+ @classmethod
531
+ def from_dic(cls, dic: dict):
532
+ if not dic:
533
+ return None
534
+
535
+ model = BotInfo()
536
+ for k, v in dic.items():
537
+ if hasattr(model, k):
538
+ setattr(model, k, v)
539
+
540
+ if '_id' in dic:
541
+ setattr(model, 'id', dic['_id'])
542
+
543
+ return model
544
+
545
+ def to_dic(self):
546
+ result = copy.deepcopy(self.__dict__)
547
+ return result
548
+
549
+
519
550
  class SlackReplyModel(BaseModel):
520
551
  def __init__(self):
521
552
  super().__init__()
@@ -755,6 +755,7 @@ class DedicatedBotRepository(BaseMongoRepository):
755
755
  if '_id' in bot_dict:
756
756
  bot_dict.pop('_id')
757
757
  update_response = self.collection().update_one({"source.source_id": bot.source.source_id,
758
+ "user_name": bot.user_name,
758
759
  "user_id": to_object_id(bot.user_id)},
759
760
  {'$set': bot_dict}, upsert=True)
760
761
  bot.id = update_response.upserted_id if update_response.upserted_id else bot.id