django-restit 4.1.14__py3-none-any.whl → 4.1.16__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.
- {django_restit-4.1.14.dist-info → django_restit-4.1.16.dist-info}/METADATA +1 -1
- {django_restit-4.1.14.dist-info → django_restit-4.1.16.dist-info}/RECORD +10 -10
- incident/models/event.py +2 -2
- rest/__init__.py +1 -1
- rest/models/base.py +3 -3
- rest/search.py +1 -1
- rest/ua.py +13 -1
- taskqueue/periodic.py +6 -2
- {django_restit-4.1.14.dist-info → django_restit-4.1.16.dist-info}/LICENSE.md +0 -0
- {django_restit-4.1.14.dist-info → django_restit-4.1.16.dist-info}/WHEEL +0 -0
@@ -86,7 +86,7 @@ incident/migrations/0007_event_metadata.py,sha256=syxcM4gIcBwSjcpdU69CXq5dGS1Gu8
|
|
86
86
|
incident/migrations/0008_incident_action_sent_incident_hostname_and_more.py,sha256=N2D47E9k4PxOo-9C72gqYkb6K0GqVIO4PkvdnWlrSuA,903
|
87
87
|
incident/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
88
88
|
incident/models/__init__.py,sha256=adTSOSVrYJgHD4hZNJJjFj_M1QZbpwhZZQiIzanUKA8,167
|
89
|
-
incident/models/event.py,sha256=
|
89
|
+
incident/models/event.py,sha256=p1N9_gG-1OLBZ9BN93PRauHSB13nWH2H9gU-X2YthCo,5070
|
90
90
|
incident/models/incident.py,sha256=BNK9gEXz_GrhiKdhC985GCbc7MgbXA31UxvmYqLYkU0,10022
|
91
91
|
incident/models/ossec.py,sha256=pWMqcuTRxPFTEF-OZQSMn7YpNEE9mfsI4GMhWWjJs5I,2187
|
92
92
|
incident/models/rules.py,sha256=67fbtEDfznxCYb-B89417lgYesN12PzmY25WBF_65a8,5300
|
@@ -342,7 +342,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
|
|
342
342
|
rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
|
343
343
|
rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
|
344
344
|
rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
|
345
|
-
rest/__init__.py,sha256=
|
345
|
+
rest/__init__.py,sha256=55bVWCfeW183Yg3vCEJi2Kc0S6HRRfKn19IMdIH9a2M,121
|
346
346
|
rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
|
347
347
|
rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
|
348
348
|
rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
|
@@ -374,13 +374,13 @@ rest/middleware/request.py,sha256=OlWE4_8nJ1krzuiNn2heecPxqtbTEhFzGYp3_7bnEEA,41
|
|
374
374
|
rest/middleware/session.py,sha256=zHSoQpIzRLmpqr_JvW406wzpvU3W3gDbm5JhtzLAMlE,10240
|
375
375
|
rest/middleware/session_store.py,sha256=X_i06TnZLW1srV0vkjjLhZ7fl1G56PswXxRpVzdFasw,1874
|
376
376
|
rest/models/__init__.py,sha256=M8pvFDq-WCF-QcM58X7pMufYYe0aaQ3U0PwGe9TKbbY,130
|
377
|
-
rest/models/base.py,sha256=
|
377
|
+
rest/models/base.py,sha256=nVLZPUnTlPtsHTc-2g9-Yw7iLDLMEUelo7hqbF-Uohg,62375
|
378
378
|
rest/models/cacher.py,sha256=eKz8TINVhWEqKhJGMsRkKZTtBUIv5rN3NHbZwOC56Uk,578
|
379
379
|
rest/models/metadata.py,sha256=GZTrDXms3jumo7dFq2zpY3x4EzGZWwryn5Jfsr6Wg2Y,11894
|
380
380
|
rest/regexes.yaml,sha256=VoGb4E-P_K9f82Yzcpltgzekpt9usRtwu9PYlo46nUw,149463
|
381
381
|
rest/requestex.py,sha256=htoLVg6tvVozrjAqzgLR8hONblyH4DWph47xOwcUIv8,15472
|
382
382
|
rest/rpc.py,sha256=KMih2Z4Z0Pqgwmcy_14nKqMCKJ9lGDJ6-vwMA2NSlyQ,3713
|
383
|
-
rest/search.py,sha256=
|
383
|
+
rest/search.py,sha256=UPnUldROiq65KmnEn-FIsgnpxk0wcXVu7I2NGfB7A-Q,7645
|
384
384
|
rest/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
385
385
|
rest/serializers/collection.py,sha256=7vDmuz6alautQVr9VsVCFQdQdJcZR9tkrOEs2b_mKQw,2015
|
386
386
|
rest/serializers/csv.py,sha256=nae_SIIpDH7HReErjNacVxEujzTvJqQxHd29BY-RXh0,2975
|
@@ -401,7 +401,7 @@ rest/templates/email/error.html,sha256=JDtB0egYLHDZS6KCNFslgB4ZiaidfPdjkTXaHiyVb
|
|
401
401
|
rest/templates/email/error.subject,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
402
402
|
rest/templates/rest_docs.html,sha256=lr5p3ic0uCRli9KEvoULTa5a3_54wNE5yL16kN1uau8,7148
|
403
403
|
rest/templates/rest_html.html,sha256=wGZV3j_tB9rzzJlsMxidUQ5ex_uRPyU_s8GCmHLXiqk,10880
|
404
|
-
rest/ua.py,sha256=
|
404
|
+
rest/ua.py,sha256=0wwOtJPWCiCxUKzWKyMApRbSaiuAxCCk0Pe3OwzYBhE,185398
|
405
405
|
rest/uberdict.py,sha256=ivDpzfchQqX8dM2_TtuyMW7NNO-j7zDmxkdKixQxvU4,17064
|
406
406
|
rest/url_docs.py,sha256=O8O_CQso3fB-7o-huidIT1BRGv5R6lDW-yKHnsGyAPk,11881
|
407
407
|
rest/urls.py,sha256=U3eD9kI19wp-NkkXCiAjdQe560fslskQngStRcGDS0I,1787
|
@@ -421,7 +421,7 @@ taskqueue/admin.py,sha256=E6zXoToS_ea3MdoGjZzF1JiepWFtDSoZUQdan8H-pXI,208
|
|
421
421
|
taskqueue/migrations/0001_initial.py,sha256=JwYib8CK5ftSXlfxKZUcKEEVsXktNB5q3h-2tu9inGk,4738
|
422
422
|
taskqueue/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
423
423
|
taskqueue/models.py,sha256=d2m4yERMCVy6nk4gfEljM1lMG2ukH7MfqdUIvlaeh2U,18959
|
424
|
-
taskqueue/periodic.py,sha256=
|
424
|
+
taskqueue/periodic.py,sha256=bi6-36nemjgKocIu3LxQNkTfmzVQeHVaCUa48-sW7pQ,3236
|
425
425
|
taskqueue/rpc.py,sha256=Wu6aEh8h7I7Xoaje3ufL7qMo8DUkxb9tgXeXUr4kNtc,5326
|
426
426
|
taskqueue/tq.py,sha256=PzSoDrawYcqZylruEgsK95gcJ4J_VhdM6rxg9V6_X8E,942
|
427
427
|
taskqueue/transports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -452,7 +452,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
452
452
|
ws4redis/settings.py,sha256=lF-6nzv7SWjmFgmontpZKdSBhp8q4FhvFOcEYZGR8pc,1411
|
453
453
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
454
454
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
455
|
-
django_restit-4.1.
|
456
|
-
django_restit-4.1.
|
457
|
-
django_restit-4.1.
|
458
|
-
django_restit-4.1.
|
455
|
+
django_restit-4.1.16.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
456
|
+
django_restit-4.1.16.dist-info/METADATA,sha256=RN25T2gjqCvwXJaZ-4CyUraCPNvLLx3evLCpXk-gbSg,7532
|
457
|
+
django_restit-4.1.16.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
458
|
+
django_restit-4.1.16.dist-info/RECORD,,
|
incident/models/event.py
CHANGED
@@ -14,7 +14,7 @@ from .rules import Rule
|
|
14
14
|
|
15
15
|
INCIDENT_METRICS = settings.get("INCIDENT_METRICS", False)
|
16
16
|
INCIDENT_EVENT_METRICS = settings.get("INCIDENT_EVENT_METRICS", False)
|
17
|
-
EVENT_TO_INCIDENT_LEVEL = settings.get("EVENT_TO_INCIDENT_LEVEL",
|
17
|
+
EVENT_TO_INCIDENT_LEVEL = settings.get("EVENT_TO_INCIDENT_LEVEL", 4)
|
18
18
|
|
19
19
|
|
20
20
|
logger = log.getLogger("incident", filename="incident.log")
|
@@ -117,7 +117,7 @@ class Event(JSONMetaData, rm.RestModel):
|
|
117
117
|
elif self.level >= EVENT_TO_INCIDENT_LEVEL:
|
118
118
|
# we ignore levels 4 and higher if they did not create a rule
|
119
119
|
self.save()
|
120
|
-
logger.info(f"ignore event {self.pk} {self.description}")
|
120
|
+
# logger.info(f"ignore event {self.pk} {self.description}")
|
121
121
|
return
|
122
122
|
|
123
123
|
# always create an incident
|
rest/__init__.py
CHANGED
rest/models/base.py
CHANGED
@@ -511,9 +511,9 @@ class RestModel(object):
|
|
511
511
|
self.restSaveField(key, value, has_fields, has_no_fields, using=using)
|
512
512
|
|
513
513
|
rfiles = self.restSaveFiles(request, files)
|
514
|
-
|
515
|
-
|
516
|
-
|
514
|
+
if getattr(self.RestMeta, "ALWAYS_SAVE", True) or len(self._changed__):
|
515
|
+
self.on_rest_pre_save(request)
|
516
|
+
self.save(using=using)
|
517
517
|
for key, value in list(deferred.items()):
|
518
518
|
self.restSaveField(key, value, has_fields, has_no_fields, using=using)
|
519
519
|
|
rest/search.py
CHANGED
@@ -202,7 +202,7 @@ def get_query(query_string, search_fields, value_fields=[], default_filter="icon
|
|
202
202
|
if query is None:
|
203
203
|
query = or_query
|
204
204
|
else:
|
205
|
-
query = query
|
205
|
+
query = query | or_query
|
206
206
|
terms = [x for x in terms if x not in remove_terms]
|
207
207
|
return query
|
208
208
|
|
rest/ua.py
CHANGED
@@ -469,8 +469,13 @@ def GetFilters(
|
|
469
469
|
return filters
|
470
470
|
|
471
471
|
|
472
|
-
|
473
472
|
USER_AGENT_PARSERS = [
|
473
|
+
UserAgentParser(
|
474
|
+
'^(Indica.+?)/(\\d+)\\.(\\d+)\\.(\\d+)\s\((.+?)\)\s(.+?)/(.+?)$',
|
475
|
+
None,
|
476
|
+
None,
|
477
|
+
None,
|
478
|
+
),
|
474
479
|
UserAgentParser(
|
475
480
|
'(GeoEvent Server) (\\d+)(?:\\.(\\d+)(?:\\.(\\d+)|)|)',
|
476
481
|
None,
|
@@ -2419,6 +2424,13 @@ DEVICE_PARSERS = [
|
|
2419
2424
|
'Spider',
|
2420
2425
|
'Smartphone',
|
2421
2426
|
),
|
2427
|
+
DeviceParser(
|
2428
|
+
'^Indica.+?/.+?\s\((.+?)\)\s(.+?)/(.+?)$',
|
2429
|
+
None,
|
2430
|
+
"iPad",
|
2431
|
+
"$2",
|
2432
|
+
"$3"
|
2433
|
+
),
|
2422
2434
|
DeviceParser(
|
2423
2435
|
'(?:DoCoMo|\\bMOT\\b|\\bLG\\b|Nokia|Samsung|SonyEricsson).*(?:(?:Bot|Yeti)-Mobile|bots?/\\d|(?:bot|crawler)\\.html|(?:jump|google|Wukong)bot|ichiro/mobile|/spider|YahooSeeker)',
|
2424
2436
|
'i',
|
taskqueue/periodic.py
CHANGED
@@ -64,6 +64,10 @@ def run_retry(force=False, verbose=False, now=None):
|
|
64
64
|
else:
|
65
65
|
retry.failed("stale")
|
66
66
|
|
67
|
+
checkBackLog()
|
68
|
+
|
69
|
+
|
70
|
+
def checkBackLog():
|
67
71
|
# check if we have back log
|
68
72
|
qset = Task.objects.filter(state=TASK_STATE_SCHEDULED)
|
69
73
|
backlog_count = qset.count()
|
@@ -73,8 +77,8 @@ def run_retry(force=False, verbose=False, now=None):
|
|
73
77
|
for key, value in helpers.countOccurences(qset, "channel").items():
|
74
78
|
details += "{} = {}\n".format(key, value)
|
75
79
|
incident.event_now(
|
76
|
-
"
|
77
|
-
details=details, level=3)
|
80
|
+
"taskqueue_errors", f"Task Queue Backlog of {backlog_count}",
|
81
|
+
details=details, level=3)
|
78
82
|
|
79
83
|
|
80
84
|
@periodic(minute=45, hour=10)
|
File without changes
|
File without changes
|