Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
InterRadio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
rokoli
InterRadio
Commits
ebd07918
Commit
ebd07918
authored
3 months ago
by
Robert
Browse files
Options
Downloads
Patches
Plain Diff
refactor: lint models.py
parent
871a0559
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
import_jobs/models.py
+4
-8
4 additions, 8 deletions
import_jobs/models.py
with
4 additions
and
8 deletions
import_jobs/models.py
+
4
−
8
View file @
ebd07918
...
...
@@ -9,11 +9,6 @@ from condator.serializers import ArchiveSerializer
class
ImportJob
(
models
.
Model
):
"""
model class for import jobs
"""
class
Meta
:
ordering
=
[
"
-created_at
"
]
class
State
(
models
.
TextChoices
):
VALIDATING
=
(
"
VALIDATING
"
,
"
Validating
"
)
VALIDATED
=
(
"
VALIDATED
"
,
"
Validated
"
)
...
...
@@ -25,8 +20,6 @@ class ImportJob(models.Model):
state
=
models
.
CharField
(
"
State
"
,
choices
=
State
.
choices
,
default
=
State
.
VALIDATING
,
max_length
=
16
)
# ToDo: Validierung der Show-Namen. Es muss erst geklärt werden, wie verfügbare Shows von Aura
# gesynced werden
show
=
models
.
CharField
(
"
Show
"
,
max_length
=
80
,
...
...
@@ -40,6 +33,9 @@ class ImportJob(models.Model):
errors
=
models
.
TextField
(
"
Errors
"
,
blank
=
True
,
null
=
True
)
is_valid
=
models
.
BooleanField
(
"
Is valid
"
,
blank
=
True
,
null
=
True
)
class
Meta
:
ordering
=
[
"
-created_at
"
]
def
get_absolute_url
(
self
):
return
reverse
(
"
import-job-detail
"
,
kwargs
=
{
"
pk
"
:
self
.
pk
})
...
...
@@ -55,7 +51,7 @@ class ImportJob(models.Model):
serializer
=
self
.
_create_serializer
()
self
.
is_valid
=
serializer
.
is_valid
self
.
errors
=
(
"
,<br>
"
)
.
join
(
map
(
str
,
serializer
.
errors
))
self
.
errors
=
"
,<br>
"
.
join
(
map
(
str
,
serializer
.
errors
))
self
.
state
=
ImportJob
.
State
.
VALIDATED
self
.
save
()
...
...
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