Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FUSS
octomon
Commits
44ad1256
Commit
44ad1256
authored
Nov 10, 2018
by
root
Browse files
Fix non acked alarms calculation
parent
c25ee3a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
schools/templates/schools/school_log.html
View file @
44ad1256
...
...
@@ -20,7 +20,7 @@
{% for d in data %}
<tr>
<td>
{% if d.
school.
get_non_acked_alarms %}
<i
class=
"fa fa-times"
aria-hidden=
"true"
style=
"color:red;"
></i>
{% if d.get_non_acked_alarms %}
<i
class=
"fa fa-times"
aria-hidden=
"true"
style=
"color:red;"
></i>
{% else %}
<i
class=
"fa fa-check"
aria-hidden=
"true"
style=
"color:green;"
></i>
{% endif %}
</td>
...
...
schools/views.py
View file @
44ad1256
...
...
@@ -425,7 +425,17 @@ def school_log(request):
if
not
request
.
user
.
is_superuser
:
messages
.
error
(
request
,
_
(
"You don't have the permissions to see this data"
))
return
HttpResponseRedirect
(
reverse
(
'home'
))
data
=
smodels
.
SchoolKeyUsage
.
objects
.
filter
(
school__dismissed
=
False
).
values
(
"school__name"
,
"school__pk"
).
annotate
(
last
=
Max
(
"timestamp"
)).
order_by
(
"last"
)
_data
=
smodels
.
SchoolKeyUsage
.
objects
.
filter
(
school__dismissed
=
False
).
values
(
"school__name"
,
"school__pk"
).
annotate
(
last
=
Max
(
"timestamp"
)).
order_by
(
"last"
)
data
=
[]
for
x
in
_data
:
school
=
smodels
.
School
.
objects
.
get
(
pk
=
x
[
"school__pk"
])
class
School
(
object
):
school__name
=
x
[
"school__name"
]
school__pk
=
x
[
"school__pk"
]
last
=
x
[
"last"
]
get_non_acked_alarms
=
school
.
get_non_acked_alarms
data
.
append
(
School
())
return
render
(
request
,
'schools/school_log.html'
,
{
'data'
:
data
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment