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
ecb6c2d9
Commit
ecb6c2d9
authored
2 years ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
validate end date
parent
8e9a68ce
No related branches found
No related tags found
No related merge requests found
Pipeline
#12254
passed
2 years ago
Stage: build
Stage: test_deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contracts/models.py
+11
-0
11 additions, 0 deletions
contracts/models.py
with
11 additions
and
0 deletions
contracts/models.py
+
11
−
0
View file @
ecb6c2d9
...
...
@@ -657,6 +657,17 @@ class Contract(NameStrMixin, models.Model):
}
)
if
(
self
.
valid_start_date
and
self
.
valid_end_date
and
self
.
valid_start_date
>
self
.
valid_end_date
):
raise
ValidationError
(
{
"
valid_end_date
"
:
"
Konec platnosti nemůže být definován dříve, než začátek.
"
}
)
if
self
.
cost_amount
is
None
and
self
.
cost_unit
:
# 0 is falsy, but a value
raise
ValidationError
(
{
"
cost_unit
"
:
"
Nemůže být definováno, pokud nejsou zadány náklady.
"
}
...
...
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