django-restit 4.1.60__py3-none-any.whl → 4.1.62__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.
@@ -92,7 +92,7 @@
92
92
 
93
93
  <body style="background-color:white;">
94
94
 
95
- <div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;"> {{incident.description}} </div>
95
+ <div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;"> {% if history %}{{history.note}}{% else %}{{incident.description}}{% endif %}</div>
96
96
  <div style="background-color:white;">
97
97
  <!--[if mso | IE]>
98
98
  <table
@@ -157,8 +157,8 @@
157
157
  <tr>
158
158
  <td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
159
159
  <![endif]-->
160
- <div style="background:#4f82f6;background-color:#4f82f6;margin:0px auto;border-radius:4px;max-width:800px;">
161
- <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#4f82f6;background-color:#4f82f6;width:100%;border-radius:4px;border-bottom:1px solid black;">
160
+ <div style="background:#dc3545;background-color:#dc3545;margin:0px auto;border-radius:4px;max-width:800px;">
161
+ <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#dc3545;background-color:#dc3545;width:100%;border-radius:4px;border-bottom:1px solid black;">
162
162
  <tbody>
163
163
  <tr>
164
164
  <td style="direction:ltr;font-size:0px;padding:0;text-align:center;">
@@ -178,9 +178,9 @@
178
178
  <img src="https://i.imgur.com/bQM8aTE.png" alt="">
179
179
  </td>
180
180
  <td align="left" style="font-size:0px;padding:0;word-break:break-word;">
181
- <div style="font-family:Roboto, Helvetica, Arial, sans-serif;font-size:30px;font-weight:300;line-height:30px;text-align:left;color:#FFFFFF;">
181
+ <div style="font-family:Roboto, Helvetica, Arial, sans-serif;font-size:22px;font-weight:300;line-height:22px;text-align:left;color:#FFFFFF;">
182
182
 
183
- New Incident on {{incident.hostname}}</div>
183
+ <span style="font-weight:bold;">{{incident.get_state_display}}</span> Incident #{{incident.pk}} on {{incident.hostname}}</div>
184
184
 
185
185
  </td>
186
186
  </tr>
@@ -188,24 +188,42 @@
188
188
  <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;background: #FFFFFF;background-color: #FFFFFF;margin: 0;" width="100%">
189
189
  <tr>
190
190
  <td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;text-align: center;background: #e4e4e4; background-color: #e4e4e4;">
191
- <div style="font-family:Roboto, Helvetica, Arial, sans-serif;font-size:20px;font-weight:300;font-style:italic;line-height:30px;text-align:center;color:#000000;">
191
+ <div style="font-family:Roboto, Helvetica, Arial, sans-serif;font-size:20px;font-weight:300;font-style:italic;line-height:20px;text-align:center;color:#000000;">
192
192
  {{incident.description}}
193
193
  </div>
194
194
  </td>
195
195
  </tr>
196
196
  <tr>
197
197
  <td>
198
- <pre style="font-size: 16px; overflow-x: scroll; word-wrap: normal; max-width: 980px; padding: 8px;">{{incident.first_event.details}}
198
+ <pre style="font-size: 16px; overflow-x: scroll; word-wrap: normal; max-width: 980px; padding: 8px;">{{incident.first_event.details_by_category}}
199
199
  </pre>
200
200
  </td>
201
201
  </tr>
202
+ {% if history %}
203
+ <tr>
204
+ <td>
205
+ <pre style="font-size: 20px; overflow-x: scroll; word-wrap: normal; max-width: 980px; padding: 8px;font-weight: bold;">
206
+ updated by: {% if history %}{{history.by.username}}{% else %}system{% endif %}
207
+
208
+ {{history.note}}
209
+ </pre>
210
+ </td>
211
+ </tr>
212
+ {% endif %}
213
+ <tr>
214
+ <td>
215
+ <div style="font-family:Roboto, Helvetica, Arial, sans-serif;font-size:16;font-weight:300;font-style:italic;line-height:30px;text-align:left;">
216
+ You can respond to this email with notes or actions. Make sure to leave to blank lines at the end of your email. For actions just include one of these words on its own line: "open", "close", "pause", "ignore".
217
+ </div>
218
+ </td>
219
+ </tr>
202
220
 
203
221
  <tr>
204
222
  <td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
205
223
  <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;">
206
224
  <tr>
207
- <td align="center" bgcolor="#4f82f6" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:8px 16px;background:#4f82f6;" valign="middle">
208
- <a href="{{portal_url}}" style="display: inline-block; background: #4f82f6; color: white; font-family: Roboto, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 16px; margin: 0; text-decoration: none; text-transform: none; padding: 12px 20px; mso-padding-alt: 0px; border-radius: 3px;" target="_blank"> VIEW ON PORTAL </a>
225
+ <td align="center" bgcolor="#dc3545" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:8px 16px;background:#dc3545;" valign="middle">
226
+ <a href="{{portal_url}}?incident={{incident.pk}}" style="display: inline-block; background: #dc3545; color: white; font-family: Roboto, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 16px; margin: 0; text-decoration: none; text-transform: none; padding: 12px 20px; mso-padding-alt: 0px; border-radius: 3px;" target="_blank"> VIEW ON PORTAL </a>
209
227
  </td>
210
228
  </tr>
211
229
  </table>
incident/tq.py CHANGED
@@ -80,22 +80,30 @@ def on_incoming_email(task):
80
80
  lines = body.split("\n")
81
81
  note = []
82
82
  for line in lines:
83
- if line.strip().lower() in ["closed", "resolved", "handled"]:
83
+ if line.strip().lower() in ["close", "closed", "resolve", "resolved", "handled"]:
84
84
  obj.state = ia.INCIDENT_STATE_RESOLVED
85
85
  obj.save()
86
- obj.logHistory("history", f"resolved by {username}")
87
- elif line.strip().lower() in ["open"]:
86
+ msg = f"resolved by {username}"
87
+ note.append(msg)
88
+ obj.logHistory("history", msg, notify=False)
89
+ elif line.strip().lower() in ["open", "accept"]:
88
90
  obj.state = ia.INCIDENT_STATE_OPENED
89
91
  obj.save()
90
- obj.logHistory("history", f"opened by {username}")
92
+ msg = f"opened by {username}"
93
+ note.append(msg)
94
+ obj.logHistory("history", msg, notify=False)
91
95
  elif line.strip().lower() in ["ignore"]:
92
96
  obj.state = ia.INCIDENT_STATE_IGNORE
93
97
  obj.save()
94
- obj.logHistory("history", f"ignored by {username}")
98
+ msg = f"ignored by {username}"
99
+ note.append(msg)
100
+ obj.logHistory("history", msg, notify=False)
95
101
  elif line.strip().lower() in ["pause"]:
96
102
  obj.state = ia.INCIDENT_STATE_PAUSE
97
103
  obj.save()
98
- obj.logHistory("history", f"paused by {username}")
104
+ msg = f"paused by {username}"
105
+ note.append(msg)
106
+ obj.logHistory("history", msg, notify=False)
99
107
  else:
100
108
  note.append(line)
101
109
  obj.logHistory("email", "\n".join(note), member=member)
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.1.60"
4
+ __version__ = "4.1.62"