leadguru-jobs 0.704.0__py3-none-any.whl → 0.706.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.
- {leadguru_jobs-0.704.0.dist-info → leadguru_jobs-0.706.0.dist-info}/METADATA +6 -2
- {leadguru_jobs-0.704.0.dist-info → leadguru_jobs-0.706.0.dist-info}/RECORD +6 -6
- {leadguru_jobs-0.704.0.dist-info → leadguru_jobs-0.706.0.dist-info}/WHEEL +1 -1
- lgt_jobs/lgt_data/models/notifications/notification.py +83 -21
- lgt_jobs/lgt_data/mongo_repository.py +19 -4
- {leadguru_jobs-0.704.0.dist-info → leadguru_jobs-0.706.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: leadguru_jobs
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.706.0
|
4
4
|
Summary: LGT jobs builds
|
5
5
|
Author-email: developer@leadguru.co
|
6
6
|
Classifier: Development Status :: 5 - Production/Stable
|
@@ -37,3 +37,7 @@ Requires-Dist: aiohttp
|
|
37
37
|
Requires-Dist: nameparser
|
38
38
|
Requires-Dist: loguru
|
39
39
|
Requires-Dist: redmail
|
40
|
+
Dynamic: author-email
|
41
|
+
Dynamic: classifier
|
42
|
+
Dynamic: requires-dist
|
43
|
+
Dynamic: summary
|
@@ -45,7 +45,7 @@ lgt_jobs/lgt_data/engine.py,sha256=GY8FOl3dl7euKjQRML_H3ophaSTgfQ8ICMRv1NpE2oE,7
|
|
45
45
|
lgt_jobs/lgt_data/enums.py,sha256=SN2eLoB2m-bVswgLVuY46v0DhPj8IurgHY6R-KRsd6s,2621
|
46
46
|
lgt_jobs/lgt_data/helpers.py,sha256=S_1P7pnx14dllmen-TzjA9pkKWQr39x8-v6iv7FUYnQ,423
|
47
47
|
lgt_jobs/lgt_data/model.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
|
-
lgt_jobs/lgt_data/mongo_repository.py,sha256=
|
48
|
+
lgt_jobs/lgt_data/mongo_repository.py,sha256=XrRxW7zh-TC33oYrpC6Cfn25MTY6RNcrNiA-4SjvSXE,57885
|
49
49
|
lgt_jobs/lgt_data/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
lgt_jobs/lgt_data/models/base.py,sha256=YaiceCaaF45snOLx-bQoYJ1aTWrfgMQeHWjAaRnzGKE,592
|
51
51
|
lgt_jobs/lgt_data/models/boards/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -78,7 +78,7 @@ lgt_jobs/lgt_data/models/leads/extended_lead.py,sha256=ezFrKv-f5GBXr3QAM-V_qJQ-i
|
|
78
78
|
lgt_jobs/lgt_data/models/leads/lead.py,sha256=mTZh8YV06nX9OWYvv_X7rDdIperB-RPChrEuheeYMU0,1300
|
79
79
|
lgt_jobs/lgt_data/models/leads/message.py,sha256=7mXwYfSpmhY_zC8TfUdAZzxsPP-02bOqVjdkN4Vid5s,1533
|
80
80
|
lgt_jobs/lgt_data/models/notifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
81
|
-
lgt_jobs/lgt_data/models/notifications/notification.py,sha256=
|
81
|
+
lgt_jobs/lgt_data/models/notifications/notification.py,sha256=lRZJIVOrKy9xLo-HwUQBfLDmUXPT8rK-IC8iwfM1q-8,25079
|
82
82
|
lgt_jobs/lgt_data/models/notifications/notification_settings.py,sha256=VFddLvk2ROz4n50wYuZmqBDn7MssFwj-e9DbWweIVA4,2780
|
83
83
|
lgt_jobs/lgt_data/models/people/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
84
84
|
lgt_jobs/lgt_data/models/people/people.py,sha256=pm60uMVmNIxOGCBAtZWhmXSJOe0SJ4C1y_HurUq00oY,3420
|
@@ -108,7 +108,7 @@ lgt_jobs/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
108
108
|
lgt_jobs/services/k8_manager.py,sha256=bXpka9psIQ5UJ6QG_e4xolmE_3gtmNrzzZeL03bJ62I,995
|
109
109
|
lgt_jobs/services/web_client.py,sha256=oMyWJxwGeIe3f40fPT7xcisjDg3BhA3Ipf8dr1jVT-Y,1549
|
110
110
|
lgt_jobs/templates/new_message.html,sha256=dZl8UmdAOOMq4nidvAgMFroSrTV7Pw0RWt2yLp_2idg,6989
|
111
|
-
leadguru_jobs-0.
|
112
|
-
leadguru_jobs-0.
|
113
|
-
leadguru_jobs-0.
|
114
|
-
leadguru_jobs-0.
|
111
|
+
leadguru_jobs-0.706.0.dist-info/METADATA,sha256=gQ-10oYW0PBsPeVygvf2ChsJNhl8blZ8LsIwALf-9Qc,1399
|
112
|
+
leadguru_jobs-0.706.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
113
|
+
leadguru_jobs-0.706.0.dist-info/top_level.txt,sha256=rIuw1DqwbnZyeoarBSC-bYeGOhv9mZBs7_afl9q4_JI,9
|
114
|
+
leadguru_jobs-0.706.0.dist-info/RECORD,,
|
@@ -54,6 +54,7 @@ class Notification(DictionaryModel):
|
|
54
54
|
class IncomingMessageNotification(Notification):
|
55
55
|
|
56
56
|
other_leads_text = ' and other leads.'
|
57
|
+
|
57
58
|
name_html_item = '''
|
58
59
|
<div style="display: inline-block; padding-left: 2px" class="lead_names">
|
59
60
|
<img alt="Lead Photo" src="$$USER_IMAGE$$" width="24" height="24"
|
@@ -176,33 +177,94 @@ class IncomingMessageNotification(Notification):
|
|
176
177
|
|
177
178
|
|
178
179
|
class InboxNotification(Notification):
|
180
|
+
name_html_item = '''
|
181
|
+
<div style="display: inline-block; padding-left: 2px" class="lead_names">
|
182
|
+
<img alt="Lead Photo" src="$$USER_IMAGE$$" width="24" height="24"
|
183
|
+
style="background-color: #FFFFFE !important; display: inline-block; vertical-align: top; width: 24px;
|
184
|
+
max-width: 24px; min-width: 24px; font-family: 'Outfit', Helvetica, Arial, sans-serif; color: #FFFFFE;
|
185
|
+
border-radius: 50% !important; font-size: 16px;" border="0">
|
186
|
+
<span style="font-weight: 600;">$$USER_NAME$$</span>
|
187
|
+
</div>
|
188
|
+
'''
|
189
|
+
new_request_html_item = '''
|
190
|
+
<tr>
|
191
|
+
<td bgcolor="#FFFFFE" align="left" style="padding-top: 16px;"
|
192
|
+
class="pr-bg-dark pr-text-dark">
|
193
|
+
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">
|
194
|
+
<tr>
|
195
|
+
<td bgcolor="#FFFFFE" align="left"
|
196
|
+
class="pr-bg-dark pr-text-dark"
|
197
|
+
style="font-family: 'Outfit', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 20px;">
|
198
|
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0"
|
199
|
+
style="border-collapse: separate !important;">
|
200
|
+
<tr>
|
201
|
+
<td align="center" bgcolor="#FFFFFE" style="border-radius: 50% !important;">
|
202
|
+
<img alt="Lead Photo" src="$$USER_IMAGE$$" width="24"
|
203
|
+
height="24"
|
204
|
+
style="display: inline-block; vertical-align: middle; width: 24px; max-width: 24px; min-width: 24px; font-family: 'Outfit', Helvetica, Arial, sans-serif; color: #FFFFFE; border-radius: 50% !important; font-size: 16px;"
|
205
|
+
border="0">
|
206
|
+
</td>
|
207
|
+
<td align="center"
|
208
|
+
class="pr-text-dark"
|
209
|
+
style="white-space: nowrap; font-family: 'Outfit', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 600; line-height: 20px; padding-left: 4px">
|
210
|
+
$$USER_NAME$$
|
211
|
+
</td>
|
212
|
+
</tr>
|
213
|
+
</table>
|
214
|
+
</td>
|
215
|
+
</tr>
|
179
216
|
|
217
|
+
<tr>
|
218
|
+
<td align="left" style="padding-top: 8px">
|
219
|
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0"
|
220
|
+
style="border-collapse: separate !important;">
|
221
|
+
<tr>
|
222
|
+
<td align="left" bgcolor="#F6F6F8"
|
223
|
+
class="sec-bg-dark pr-text-dark"
|
224
|
+
style="color: #262730; font-family: 'Outfit', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 400; line-height: 20px; padding: 12px; border-radius: 0 12px 12px 12px !important; background-color: #F6F6F8">
|
225
|
+
$$REQUEST_TEXT$$
|
226
|
+
</td>
|
227
|
+
</tr>
|
228
|
+
</table>
|
229
|
+
</td>
|
230
|
+
</tr>
|
231
|
+
</table>
|
232
|
+
</td>
|
233
|
+
</tr>
|
234
|
+
'''
|
180
235
|
@staticmethod
|
181
|
-
def get_button_name():
|
182
|
-
return 'View message request'
|
236
|
+
def get_button_name(users: list):
|
237
|
+
return 'View message requests' if len(users) > 1 else 'View message request'
|
183
238
|
|
184
239
|
@staticmethod
|
185
|
-
def
|
240
|
+
def get_chat_url():
|
186
241
|
return f'{portal_url}/feed?requests=true'
|
187
242
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
243
|
+
@staticmethod
|
244
|
+
def get_subject_text(users: list) -> str:
|
245
|
+
return 'New message requests on Leadguru' if len(users) > 1 else'New message request on Leadguru'
|
246
|
+
|
247
|
+
def create_title(self, user_ids: list[str], users: list):
|
248
|
+
title = ""
|
249
|
+
for user_id in user_ids[:3]:
|
250
|
+
user = [user for user in users if user_id == user['sender_id']][0]
|
251
|
+
photo = user.get('images', {}).get('image_72', '{{ IMAGE_PERSON.src }}')
|
252
|
+
item = self.name_html_item.replace('$$USER_NAME$$', user['real_name'])
|
253
|
+
item = item.replace('$$USER_IMAGE$$', photo)
|
254
|
+
title += item
|
255
|
+
|
256
|
+
return f"New message requests from {title}" if len(users) > 1 else f"New message request from {title}"
|
257
|
+
|
258
|
+
def create_new_requests_list(self, requests: list):
|
259
|
+
new_requests = ""
|
260
|
+
for request in requests[:3]:
|
261
|
+
name = request['user']['real_name']
|
262
|
+
photo = request['user'].get('images', {}).get('image_72', '{{ IMAGE_PERSON.src }}')
|
263
|
+
item = self.new_request_html_item.replace('$$USER_NAME$$', name)
|
264
|
+
item = item.replace('$$USER_IMAGE$$', photo)
|
265
|
+
item = item.replace('$$REQUEST_TEXT$$', request['text'])
|
266
|
+
new_requests += item
|
267
|
+
return new_requests
|
206
268
|
|
207
269
|
|
208
270
|
class SourceDeactivationNotification(Notification):
|
@@ -31,7 +31,7 @@ from lgt_jobs.lgt_data.models.user.verification import UserVerificationModel
|
|
31
31
|
from lgt_jobs.lgt_data.models.user_leads.extended_user_lead import ExtendedUserLeadModel
|
32
32
|
from lgt_jobs.lgt_data.models.user_leads.user_lead import UserLeadModel
|
33
33
|
|
34
|
-
client = MongoClient(os.environ.get('MONGO_CONNECTION_STRING', 'mongodb://127.0.0.1:
|
34
|
+
client = MongoClient(os.environ.get('MONGO_CONNECTION_STRING', 'mongodb://127.0.0.1:27018/'))
|
35
35
|
|
36
36
|
|
37
37
|
def to_object_id(oid):
|
@@ -1418,10 +1418,17 @@ class MessageRequestsRepository(BaseMongoRepository):
|
|
1418
1418
|
self.collection().update_one({'user_id': to_object_id(user_id), 'sender_id': sender_id},
|
1419
1419
|
{'$set': message_request.to_dic()}, upsert=True)
|
1420
1420
|
|
1421
|
-
def get_many(self, user_id: str, viewed: bool = False):
|
1421
|
+
def get_many(self, user_id: str, viewed: bool = False, **kwargs):
|
1422
|
+
match_pipeline = {'user_id': to_object_id(user_id), 'viewed': viewed}
|
1423
|
+
from_date = kwargs.get('from_date')
|
1424
|
+
|
1425
|
+
if from_date:
|
1426
|
+
start = datetime(from_date.year, from_date.month, from_date.day, tzinfo=tz.tzutc())
|
1427
|
+
match_pipeline['created_at']['$gte'] = start
|
1428
|
+
|
1422
1429
|
pipeline = [
|
1423
1430
|
{
|
1424
|
-
'$match':
|
1431
|
+
'$match': match_pipeline
|
1425
1432
|
},
|
1426
1433
|
{
|
1427
1434
|
'$lookup': {
|
@@ -1432,7 +1439,15 @@ class MessageRequestsRepository(BaseMongoRepository):
|
|
1432
1439
|
}
|
1433
1440
|
},
|
1434
1441
|
{
|
1435
|
-
'$
|
1442
|
+
'$lookup': {
|
1443
|
+
'from': 'dedicated_bots',
|
1444
|
+
'localField': 'bot_id',
|
1445
|
+
'foreignField': '_id',
|
1446
|
+
'as': 'bot'
|
1447
|
+
}
|
1448
|
+
},
|
1449
|
+
{
|
1450
|
+
'$addFields': {'user': {'$first': '$user'}, 'bot': {'$first': '$bot'}}
|
1436
1451
|
},
|
1437
1452
|
{
|
1438
1453
|
'$sort': {'created_at': 1}
|
File without changes
|