django-restit 4.2.84__py3-none-any.whl → 4.2.85__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: django-restit
3
- Version: 4.2.84
3
+ Version: 4.2.85
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -112,14 +112,14 @@ incident/migrations/0015_rule_title_template_alter_incident_state.py,sha256=FPUD
112
112
  incident/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  incident/models/__init__.py,sha256=NMphuhb0RTMf7Ov4QkNv7iv6_I8Wtr3xQ54yjX_a31M,209
114
114
  incident/models/event.py,sha256=Dw6fUi2tbLeA_ZRDcvGQNFkCkMGMBdtNeaLikXdAyE8,7769
115
- incident/models/incident.py,sha256=HPbi6J9qm7_-FMjnDUPV9NcbmP_60WU-IO9HJSpoLTY,19360
115
+ incident/models/incident.py,sha256=XB7FgyV26sgxSOHu69UTlLmLs1vljf0O6KyN114Rf2I,19585
116
116
  incident/models/ossec.py,sha256=eUDRGawzuLWobKEVGKfdZisDnyjS_Hlxi0T_GCSLCCI,2252
117
117
  incident/models/rules.py,sha256=aRkJ0ZnTv87nAUC1sHVkPExfb3OJ8fgHQIhnCIpIbhQ,7001
118
118
  incident/models/ticket.py,sha256=S3kqGQpYLE6Y4M9IKu_60sgW-f592xNr8uufqHnvDoU,2302
119
119
  incident/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
120
  incident/parsers/ossec.py,sha256=jyJmNBwnQS1tjZMwYhslnCpZviCHXnozv88BPT-ytCw,11592
121
121
  incident/periodic.py,sha256=eX1rQK6v65A9ugofTvJPSmAWei6C-3EYgzCMuGZ03jM,381
122
- incident/rpc.py,sha256=viJt873b8T8SiAq10EM57lF8g7ghyj3ymdkaXzh2Ass,8181
122
+ incident/rpc.py,sha256=6JVWTTAr4CN2tAjjIUcXug1z3RhU_ar5CDLzedkduA4,8187
123
123
  incident/templates/email/incident_change.html,sha256=tQYphypwLukkVdwH0TB2Szz2VEJ7GnsfRS3_ZJ-MYeE,13895
124
124
  incident/templates/email/incident_msg.html,sha256=MZdKhTddUF2MpiH8Z3RTQEmW_ko1n3ajeZ11KLtiLlU,13780
125
125
  incident/templates/email/incident_new.html,sha256=W6nwFQROnyDfMlXub8s02ws4hGnJp16pfgp9xTm_aEc,15185
@@ -506,7 +506,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
506
506
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
507
507
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
508
508
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
509
- django_restit-4.2.84.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
510
- django_restit-4.2.84.dist-info/METADATA,sha256=nTmKDiYJinMeyK6T2939-Zs5e8U4nFoaG_EV7_D9tkQ,7645
511
- django_restit-4.2.84.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
512
- django_restit-4.2.84.dist-info/RECORD,,
509
+ django_restit-4.2.85.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
510
+ django_restit-4.2.85.dist-info/METADATA,sha256=c0_tpMC4ULCMJwzo_QfuVOwW3MRdLMhy6k1gqDHUaec,7645
511
+ django_restit-4.2.85.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
512
+ django_restit-4.2.85.dist-info/RECORD,,
@@ -4,7 +4,7 @@ from rest import settings
4
4
  from rest import models as rm
5
5
  from rest import helpers as rh
6
6
  from taskqueue.models import Task
7
- from account.models import Member
7
+ from account.models import Member, Group
8
8
  from objict import objict
9
9
  from datetime import datetime, timedelta
10
10
  from rest import log
@@ -255,10 +255,16 @@ class Incident(models.Model, rm.RestModel, rm.MetaDataModel):
255
255
  rh.log_exception("triggerSMS")
256
256
 
257
257
  def triggerGroup(self):
258
+ if self.rule.action.count(":") == 2:
259
+ action, gid, perm = self.rule.action.split(":")
260
+ self.group = Group.objects.filter(pk=int(gid)).last()
261
+ self.save()
262
+ else:
263
+ action, perm = self.rule.action.split(":")
264
+
258
265
  if not self.group:
259
266
  self.notifyWith("notify.unknown_incidents")
260
267
  return
261
- action, perm = self.rule.action.split(":")
262
268
  self.action_sent = datetime.now()
263
269
  self.save()
264
270
 
@@ -472,13 +478,13 @@ class IncidentHistory(models.Model, rm.RestModel):
472
478
  SEARCH_FIELDS = ["to__username", "note"]
473
479
  GRAPHS = {
474
480
  "default": {
475
- "extra":[
481
+ "extra": [
476
482
  ("get_state_display", "state_display"),
477
483
  ("get_priority_display", "priority_display"),
478
484
  ],
479
- "graphs":{
480
- "by":"basic",
481
- "to":"basic",
485
+ "graphs": {
486
+ "by": "basic",
487
+ "to": "basic",
482
488
  "media": "basic"
483
489
  }
484
490
  },
incident/rpc.py CHANGED
@@ -18,7 +18,7 @@ def patched_restPermissionDenied(request, error="permission denied",
18
18
  component=None, component_id=None):
19
19
 
20
20
  description = f"permission denied: {error_code} '{error}' for {request.user} {request.method}:{request.path}"
21
- rh.log_error(description)
21
+ # rh.log_error(description)
22
22
  if error_code == 404:
23
23
  if not request.path.startswith(LOG_REST_PREFIX) and not request.path.startswith("/rpc"):
24
24
  # just ignore these
@@ -61,7 +61,7 @@ def ossec_alert_creat_from_request(request):
61
61
  if payload:
62
62
  try:
63
63
  # TODO make this a task (background it)
64
- rh.log_error("parsing payload", payload)
64
+ # rh.log_error("parsing payload", payload)
65
65
  od = ossec.parseAlert(request, payload)
66
66
  # lets now create a local event
67
67
  if od is not None:
@@ -118,7 +118,7 @@ def ossec_alert_creat_from_request(request):
118
118
  "category": "ossec_error",
119
119
  "metadata": metadata
120
120
  })
121
- rh.log_error("ossec alert", request.DATA.asDict())
121
+ # rh.log_error("ossec alert", request.DATA.asDict())
122
122
  return rv.restStatus(request, False, error="no alert data")
123
123
 
124
124