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
d98f15ff
Commit
d98f15ff
authored
Dec 10, 2012
by
Sofia Papagiannaki
Browse files
Fix precursor application
parent
0d535a04
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/models.py
View file @
d98f15ff
...
...
@@ -1097,10 +1097,6 @@ class ProjectDefinition(models.Model):
through
=
'ProjectResourceGrant'
)
def
save
(
self
):
self
.
validate_name
()
super
(
ProjectDefinition
,
self
).
save
()
@
property
def
violated_resource_grants
(
self
):
return
False
...
...
@@ -1212,6 +1208,14 @@ class ProjectApplication(models.Model):
if
commit
:
application
.
save
()
application
.
definition
.
resource_policies
=
resource_policies
# better implementation ???
if
precursor_application
:
try
:
precursor
=
ProjectApplication
.
objects
.
get
(
id
=
precursor_application_id
)
except
:
pass
application
.
precursor_application
=
precursor
application
.
save
()
else
:
notification
=
build_notification
(
settings
.
SERVER_EMAIL
,
...
...
@@ -1226,6 +1230,10 @@ class ProjectApplication(models.Model):
"""
If approval_user then during owner membership acceptance
it is checked whether the request_user is eligible.
Raises:
ValidationError: if there is other alive project with the same name
"""
if
self
.
state
!=
PENDING
:
return
...
...
@@ -1249,6 +1257,7 @@ class ProjectApplication(models.Model):
project
.
last_approval_date
=
datetime
.
now
()
project
.
save
()
self
.
precursor_application
.
state
=
REPLACED
self
.
definition
.
validate_name
()
self
.
state
=
APPROVED
self
.
save
()
...
...
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