Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
synnefo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
itminedu
synnefo
Commits
afb39799
Commit
afb39799
authored
12 years ago
by
Sofia Papagiannaki
Browse files
Options
Downloads
Patches
Plain Diff
Check project dates (better implementation)
parent
57292428
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
snf-astakos-app/astakos/im/forms.py
+3
-4
3 additions, 4 deletions
snf-astakos-app/astakos/im/forms.py
with
3 additions
and
4 deletions
snf-astakos-app/astakos/im/forms.py
+
3
−
4
View file @
afb39799
...
...
@@ -775,8 +775,7 @@ class ProjectApplicationForm(forms.ModelForm):
def
clean_start_date
(
self
):
start_date
=
self
.
cleaned_data
.
get
(
'
start_date
'
)
if
not
self
.
precursor_application
:
now
=
datetime
.
now
()
if
start_date
and
now
-
start_date
>
timedelta
(
days
=
1
):
if
start_date
and
(
start_date
-
datetime
.
now
()).
days
<
0
:
raise
forms
.
ValidationError
(
_
(
astakos_messages
.
INVALID_PROJECT_START_DATE
))
return
start_date
...
...
@@ -785,10 +784,10 @@ class ProjectApplicationForm(forms.ModelForm):
start_date
=
self
.
cleaned_data
.
get
(
'
start_date
'
)
end_date
=
self
.
cleaned_data
.
get
(
'
end_date
'
)
now
=
datetime
.
now
()
if
end_date
and
now
-
end_date
>
timedelta
(
days
=
1
)
:
if
end_date
and
(
end_date
-
now
).
days
<
0
:
raise
forms
.
ValidationError
(
_
(
astakos_messages
.
INVALID_PROJECT_END_DATE
))
if
start_date
and
end_date
<=
start_date
:
if
start_date
and
(
end_date
-
start_date
).
days
<=
0
:
raise
forms
.
ValidationError
(
_
(
astakos_messages
.
INCONSISTENT_PROJECT_DATES
))
return
end_date
...
...
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