Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
a826fd40
Commit
a826fd40
authored
Jan 13, 2017
by
Skia
Browse files
Small update on last operations view
parent
93e51776
Pipeline
#719
passed with stage
in 3 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
counter/views.py
View file @
a826fd40
...
@@ -800,8 +800,8 @@ class CounterLastOperationsView(CounterTabsMixin, CanViewMixin, DetailView):
...
@@ -800,8 +800,8 @@ class CounterLastOperationsView(CounterTabsMixin, CanViewMixin, DetailView):
"""Add form to the context """
"""Add form to the context """
kwargs
=
super
(
CounterLastOperationsView
,
self
).
get_context_data
(
**
kwargs
)
kwargs
=
super
(
CounterLastOperationsView
,
self
).
get_context_data
(
**
kwargs
)
threshold
=
timezone
.
now
()
-
timedelta
(
minutes
=
settings
.
SITH_LAST_OPERATIONS_LIMIT
)
threshold
=
timezone
.
now
()
-
timedelta
(
minutes
=
settings
.
SITH_LAST_OPERATIONS_LIMIT
)
kwargs
[
'last_refillings'
]
=
self
.
object
.
refillings
.
filter
(
date__gte
=
threshold
).
all
()
kwargs
[
'last_refillings'
]
=
self
.
object
.
refillings
.
filter
(
date__gte
=
threshold
).
order_by
(
'-id'
)[:
20
]
kwargs
[
'last_sellings'
]
=
self
.
object
.
sellings
.
filter
(
date__gte
=
threshold
).
all
()
kwargs
[
'last_sellings'
]
=
self
.
object
.
sellings
.
filter
(
date__gte
=
threshold
).
order_by
(
'-id'
)[:
20
]
return
kwargs
return
kwargs
class
CounterCashSummaryView
(
CounterTabsMixin
,
CanViewMixin
,
DetailView
):
class
CounterCashSummaryView
(
CounterTabsMixin
,
CanViewMixin
,
DetailView
):
...
...
sith/settings.py
View file @
a826fd40
...
@@ -434,7 +434,7 @@ SITH_MAXIMUM_FREE_ROLE=1
...
@@ -434,7 +434,7 @@ SITH_MAXIMUM_FREE_ROLE=1
SITH_BARMAN_TIMEOUT
=
20
SITH_BARMAN_TIMEOUT
=
20
# Minutes to delete the last operations
# Minutes to delete the last operations
SITH_LAST_OPERATIONS_LIMIT
=
5
SITH_LAST_OPERATIONS_LIMIT
=
10
# Minutes for a counter to be inactive
# Minutes for a counter to be inactive
SITH_COUNTER_MINUTE_INACTIVE
=
10
SITH_COUNTER_MINUTE_INACTIVE
=
10
...
...
Write
Preview
Supports
Markdown
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