Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Kort
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Kort
Commits
f2fd999d
Verified
Commit
f2fd999d
authored
1 year ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix lint
parent
db3dd425
No related branches found
No related tags found
1 merge request
!25
Update tox.ini
Pipeline
#172168
failed
1 year ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/kort/models.py
+4
-5
4 additions, 5 deletions
aleksis/apps/kort/models.py
aleksis/apps/kort/views.py
+1
-1
1 addition, 1 deletion
aleksis/apps/kort/views.py
with
5 additions
and
6 deletions
aleksis/apps/kort/models.py
+
4
−
5
View file @
f2fd999d
...
@@ -156,10 +156,9 @@ class CardPrinter(ExtensibleModel):
...
@@ -156,10 +156,9 @@ class CardPrinter(ExtensibleModel):
self
.
status
self
.
status
not
in
(
CardPrinterStatus
.
NOT_REGISTERED
.
value
,
CardPrinterStatus
.
OFFLINE
.
value
)
not
in
(
CardPrinterStatus
.
NOT_REGISTERED
.
value
,
CardPrinterStatus
.
OFFLINE
.
value
)
and
self
.
last_seen_at
and
self
.
last_seen_at
):
)
and
self
.
last_seen_at
<
timezone
.
now
()
-
timedelta
(
minutes
=
1
):
if
self
.
last_seen_at
<
timezone
.
now
()
-
timedelta
(
minutes
=
1
):
self
.
status
=
CardPrinterStatus
.
OFFLINE
.
value
self
.
status
=
CardPrinterStatus
.
OFFLINE
.
value
self
.
save
()
self
.
save
()
@classmethod
@classmethod
def
check_online_status_for_all
(
cls
,
qs
=
None
):
def
check_online_status_for_all
(
cls
,
qs
=
None
):
...
@@ -263,7 +262,7 @@ class CardLayout(ExtensibleModel):
...
@@ -263,7 +262,7 @@ class CardLayout(ExtensibleModel):
t
=
Template
(
self
.
template
)
t
=
Template
(
self
.
template
)
t
.
render
(
Context
())
t
.
render
(
Context
())
except
Exception
as
e
:
except
Exception
as
e
:
raise
ValidationError
(
_
(
"
Template is invalid: {}
"
).
format
(
e
))
raise
ValidationError
(
_
(
"
Template is invalid: {}
"
).
format
(
e
))
from
e
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
name
return
self
.
name
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/kort/views.py
+
1
−
1
View file @
f2fd999d
...
@@ -339,7 +339,7 @@ class CardLayoutFormMixin:
...
@@ -339,7 +339,7 @@ class CardLayoutFormMixin:
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
object
=
self
.
get_object
()
self
.
object
=
self
.
get_object
()
context
=
self
.
get_context_data
(
**
kwargs
)
self
.
get_context_data
(
**
kwargs
)
form
=
self
.
get_form
()
form
=
self
.
get_form
()
if
form
.
is_valid
()
and
self
.
formset
.
is_valid
():
if
form
.
is_valid
()
and
self
.
formset
.
is_valid
():
return
self
.
form_valid
(
form
)
return
self
.
form_valid
(
form
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment