django-restit 4.1.74__py3-none-any.whl → 4.1.75__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.
- account/models/member.py +4 -0
- {django_restit-4.1.74.dist-info → django_restit-4.1.75.dist-info}/METADATA +1 -1
- {django_restit-4.1.74.dist-info → django_restit-4.1.75.dist-info}/RECORD +7 -7
- incident/models/incident.py +10 -7
- rest/__init__.py +1 -1
- {django_restit-4.1.74.dist-info → django_restit-4.1.75.dist-info}/LICENSE.md +0 -0
- {django_restit-4.1.74.dist-info → django_restit-4.1.75.dist-info}/WHEEL +0 -0
account/models/member.py
CHANGED
@@ -82,9 +82,13 @@ class Member(User, RestModel, MetaDataModel):
|
|
82
82
|
"first_name", "last_name",
|
83
83
|
"last_activity#datetime", "date_joined#datetime",
|
84
84
|
"is_staff",
|
85
|
+
("ip", "auth_sessions__ip"),
|
85
86
|
("notify_via", "properties|notify_via"),
|
86
87
|
("phone", "phone_number"),
|
87
88
|
("perms", "properties|permissions.")]
|
89
|
+
QUERY_FIELDS_SPECIAL = {
|
90
|
+
"ip": "auth_sessions__ip",
|
91
|
+
}
|
88
92
|
UNIQUE_LOOKUP = ["username", "email"]
|
89
93
|
METADATA_FIELD_PROPERTIES = settings.USER_METADATA_PROPERTIES
|
90
94
|
GRAPHS = {
|
@@ -22,7 +22,7 @@ account/models/device.py,sha256=XipNpByreGubB5-d4ZBOoIV5Xw14b2Btcgn6fXz8HAc,4105
|
|
22
22
|
account/models/feeds.py,sha256=4n4Mv8HjcXpUmMPWafHlsGbVQ1fDKdtblL1hp30sDrg,1437
|
23
23
|
account/models/group.py,sha256=X_ij8moxmtH9qwH3w2EL8siuy-prsyxQVv1JIhBp3hI,19399
|
24
24
|
account/models/legacy.py,sha256=zYdtv4LC0ooxPVqWM-uToPwV-lYWQLorSE6p6yn1xDw,2720
|
25
|
-
account/models/member.py,sha256=
|
25
|
+
account/models/member.py,sha256=kyPnmRRG-LF9q9bOfmaGkuPHnePu8bR7wKfhlqy6Xoo,48477
|
26
26
|
account/models/membership.py,sha256=l7suW6kRCfa3KqdbqjOIO2jVhxjkPbEENdJIlj2WomY,7378
|
27
27
|
account/models/notify.py,sha256=YnZujSHJHY7B09e6FIyZIEJRWLPYk1Sk1e92tFzB1IA,12078
|
28
28
|
account/models/session.py,sha256=swhxcx_lWzOpGCmfifXoACgWYqmKmS7eZsD9s9jSToc,3509
|
@@ -94,7 +94,7 @@ incident/migrations/0011_ticket.py,sha256=Ml5E_Qi4Z0MD89fetoOFOL3rPlVQdjaaDCcFBf
|
|
94
94
|
incident/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
95
|
incident/models/__init__.py,sha256=NMphuhb0RTMf7Ov4QkNv7iv6_I8Wtr3xQ54yjX_a31M,209
|
96
96
|
incident/models/event.py,sha256=AXFV92OtnVi3opSZcRX1o3qZ8uBvqGFL549AXH2gjY8,6792
|
97
|
-
incident/models/incident.py,sha256
|
97
|
+
incident/models/incident.py,sha256=qBwXC4lhQ8YZ7EatDjOced93cXq1jJqYgElgmKfl9nw,14409
|
98
98
|
incident/models/ossec.py,sha256=pWMqcuTRxPFTEF-OZQSMn7YpNEE9mfsI4GMhWWjJs5I,2187
|
99
99
|
incident/models/rules.py,sha256=Ua-hC78_D6YikJjP3DXfA8ghi6zu__Qud8H1bk7MRG0,5342
|
100
100
|
incident/models/ticket.py,sha256=S3kqGQpYLE6Y4M9IKu_60sgW-f592xNr8uufqHnvDoU,2302
|
@@ -350,7 +350,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
350
350
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
351
351
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
352
352
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
353
|
-
rest/__init__.py,sha256=
|
353
|
+
rest/__init__.py,sha256=EBklYrW3BC8Q1_xwHhntKj0NjkG0lEqi8Nw56aKm-K0,121
|
354
354
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
355
355
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
356
356
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -482,7 +482,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
482
482
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
483
483
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
484
484
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
485
|
-
django_restit-4.1.
|
486
|
-
django_restit-4.1.
|
487
|
-
django_restit-4.1.
|
488
|
-
django_restit-4.1.
|
485
|
+
django_restit-4.1.75.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
486
|
+
django_restit-4.1.75.dist-info/METADATA,sha256=hjRHe-VVVIQu1Sqhc6pz00FdyeLdszibBJ-5coivs7I,7573
|
487
|
+
django_restit-4.1.75.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
488
|
+
django_restit-4.1.75.dist-info/RECORD,,
|
incident/models/incident.py
CHANGED
@@ -164,13 +164,16 @@ class Incident(models.Model, rm.RestModel, rm.MetaDataModel):
|
|
164
164
|
# sms:NOTIFY_SETTING
|
165
165
|
self.action_sent = datetime.now()
|
166
166
|
self.save()
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
m
|
167
|
+
try:
|
168
|
+
action, perm = self.rule.action.split(":")
|
169
|
+
members = Member.GetWithNotification(perm)
|
170
|
+
# count = self.getProperty("event_count", default=1, field_type=int)
|
171
|
+
url = F"{settings.INCIDENT_PORTAL_URL}"
|
172
|
+
msg = f"Incident #{self.pk}\n{self.description}\n<a href='{url}?incident={self.pk}'>view</a>"
|
173
|
+
for m in members:
|
174
|
+
m.sendSMS(msg)
|
175
|
+
except Exception:
|
176
|
+
rh.log_exception("triggerSMS")
|
174
177
|
|
175
178
|
def notifyWith(self, perm):
|
176
179
|
# logger.info("notifyWith", perm)
|
rest/__init__.py
CHANGED
File without changes
|
File without changes
|