Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Public contract registry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Public contract registry
Commits
8db1a387
Commit
8db1a387
authored
2 years ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
more truth-y/false-y validation
parent
a4c2e079
No related branches found
No related tags found
No related merge requests found
Pipeline
#12143
passed
2 years ago
Stage: build
Stage: test_deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
contracts/models.py
+2
-5
2 additions, 5 deletions
contracts/models.py
contracts/templates/contracts/index.html
+1
-0
1 addition, 0 deletions
contracts/templates/contracts/index.html
with
3 additions
and
5 deletions
contracts/models.py
+
2
−
5
View file @
8db1a387
...
@@ -607,16 +607,13 @@ class Contract(NameStrMixin, models.Model):
...
@@ -607,16 +607,13 @@ class Contract(NameStrMixin, models.Model):
{
"
cost_amount
"
:
"
Nemůže být definováno bez jednoty nákladů.
"
}
{
"
cost_amount
"
:
"
Nemůže být definováno bez jednoty nákladů.
"
}
)
)
if
self
.
cost_unit
==
self
.
CostUnits
.
OTHER
[
1
]
and
self
.
cost_unit_other
is
None
:
if
self
.
cost_unit
==
self
.
CostUnits
.
OTHER
[
1
]
and
not
self
.
cost_unit_other
:
raise
ValidationError
(
raise
ValidationError
(
{
{
"
cost_unit_other
"
:
"
Musí být definováno, pokud je vybrána jednotka nákladů
'
jiné
'
.
"
"
cost_unit_other
"
:
"
Musí být definováno, pokud je vybrána jednotka nákladů
'
jiné
'
.
"
}
}
)
)
elif
(
elif
self
.
cost_unit
!=
self
.
CostUnits
.
OTHER
[
1
]
and
self
.
cost_unit_other
:
self
.
cost_unit
!=
self
.
CostUnits
.
OTHER
[
1
]
and
self
.
cost_unit_other
is
not
None
):
raise
ValidationError
(
raise
ValidationError
(
{
{
"
cost_unit_other
"
:
"
Nemůže být definováno, pokud není vybrána jednotka nákladů
'
jiné
'
.
"
"
cost_unit_other
"
:
"
Nemůže být definováno, pokud není vybrána jednotka nákladů
'
jiné
'
.
"
...
...
This diff is collapsed.
Click to expand it.
contracts/templates/contracts/index.html
+
1
−
0
View file @
8db1a387
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
<h2
class=
"head-alt-md font-bold"
>
<h2
class=
"head-alt-md font-bold"
>
Všechny smlouvy
Všechny smlouvy
</h2>
</h2>
{% if request.user.can_create_contracts %}
{% if request.user.can_create_contracts %}
<a
<a
class=
"btn btn--inline-icon"
class=
"btn btn--inline-icon"
...
...
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