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):
...
@@ -1097,10 +1097,6 @@ class ProjectDefinition(models.Model):
through
=
'ProjectResourceGrant'
through
=
'ProjectResourceGrant'
)
)
def
save
(
self
):
self
.
validate_name
()
super
(
ProjectDefinition
,
self
).
save
()
@
property
@
property
def
violated_resource_grants
(
self
):
def
violated_resource_grants
(
self
):
return
False
return
False
...
@@ -1212,6 +1208,14 @@ class ProjectApplication(models.Model):
...
@@ -1212,6 +1208,14 @@ class ProjectApplication(models.Model):
if
commit
:
if
commit
:
application
.
save
()
application
.
save
()
application
.
definition
.
resource_policies
=
resource_policies
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
:
else
:
notification
=
build_notification
(
notification
=
build_notification
(
settings
.
SERVER_EMAIL
,
settings
.
SERVER_EMAIL
,
...
@@ -1226,6 +1230,10 @@ class ProjectApplication(models.Model):
...
@@ -1226,6 +1230,10 @@ class ProjectApplication(models.Model):
"""
"""
If approval_user then during owner membership acceptance
If approval_user then during owner membership acceptance
it is checked whether the request_user is eligible.
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
:
if
self
.
state
!=
PENDING
:
return
return
...
@@ -1249,6 +1257,7 @@ class ProjectApplication(models.Model):
...
@@ -1249,6 +1257,7 @@ class ProjectApplication(models.Model):
project
.
last_approval_date
=
datetime
.
now
()
project
.
last_approval_date
=
datetime
.
now
()
project
.
save
()
project
.
save
()
self
.
precursor_application
.
state
=
REPLACED
self
.
precursor_application
.
state
=
REPLACED
self
.
definition
.
validate_name
()
self
.
state
=
APPROVED
self
.
state
=
APPROVED
self
.
save
()
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