Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
9a4a1160
Commit
9a4a1160
authored
Jan 10, 2013
by
Sofia Papagiannaki
Browse files
In case of project update bypass start date check
parent
64bbce39
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/forms.py
View file @
9a4a1160
...
...
@@ -754,9 +754,6 @@ class ProjectApplicationForm(forms.ModelForm):
class
Meta
:
model
=
ProjectApplication
#include = ( 'name', 'homepage', 'description',
# 'start_date', 'end_date', 'comments')
fields
=
(
'name'
,
'homepage'
,
'description'
,
'start_date'
,
'end_date'
,
'comments'
,
'member_join_policy'
,
'member_leave_policy'
,
...
...
@@ -766,17 +763,18 @@ class ProjectApplicationForm(forms.ModelForm):
instance
=
kwargs
.
get
(
'instance'
)
self
.
precursor_application
=
instance
super
(
ProjectApplicationForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
# in case of new application remove closed join policy
if
not
instance
:
# remove closed join policy
policies
=
PROJECT_MEMBER_JOIN_POLICIES
.
copy
()
policies
.
pop
(
'3'
)
self
.
fields
[
'member_join_policy'
].
choices
=
policies
.
iteritems
()
def
clean_start_date
(
self
):
start_date
=
self
.
cleaned_data
.
get
(
'start_date'
)
now
=
datetime
.
now
()
if
start_date
and
now
-
start_date
>
timedelta
(
days
=
1
):
raise
forms
.
ValidationError
(
if
not
self
.
precursor_application
:
now
=
datetime
.
now
()
if
start_date
and
now
-
start_date
>
timedelta
(
days
=
1
):
raise
forms
.
ValidationError
(
_
(
astakos_messages
.
INVALID_PROJECT_START_DATE
))
return
start_date
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment