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
f881e3dd
Commit
f881e3dd
authored
Dec 11, 2012
by
Sofia Papagiannaki
Browse files
During project approve set precursor back sequence state to REPLACED
parent
9ca7149a
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/models.py
View file @
f881e3dd
...
@@ -1229,15 +1229,6 @@ class ProjectApplication(models.Model):
...
@@ -1229,15 +1229,6 @@ class ProjectApplication(models.Model):
application
.
state
=
PENDING
application
.
state
=
PENDING
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
else
:
application
.
precursor_application
=
precursor
application
.
save
()
notification
=
build_notification
(
notification
=
build_notification
(
settings
.
SERVER_EMAIL
,
settings
.
SERVER_EMAIL
,
...
@@ -1265,20 +1256,13 @@ class ProjectApplication(models.Model):
...
@@ -1265,20 +1256,13 @@ class ProjectApplication(models.Model):
if
self
.
state
!=
PENDING
:
if
self
.
state
!=
PENDING
:
raise
PermissionDenied
(
_
(
PROJECT_ALREADY_ACTIVE
))
raise
PermissionDenied
(
_
(
PROJECT_ALREADY_ACTIVE
))
precursor
=
self
.
precursor_application
try
:
try
:
precursor
=
self
.
precursor_application
project
=
precursor
.
project
project
=
precursor
.
project
project
.
application
=
self
project
.
application
=
self
prev_approval_date
=
project
.
last_approval_date
prev_approval_date
=
project
.
last_approval_date
project
.
last_approval_date
=
datetime
.
now
()
project
.
last_approval_date
=
datetime
.
now
()
project
.
save
()
project
.
save
()
p
=
precursor
while
p
:
p
.
state
=
REPLACED
p
.
save
()
p
=
p
.
precursor_application
except
:
except
:
kwargs
=
{
kwargs
=
{
'application'
:
self
,
'application'
:
self
,
...
@@ -1287,7 +1271,12 @@ class ProjectApplication(models.Model):
...
@@ -1287,7 +1271,12 @@ class ProjectApplication(models.Model):
}
}
project
=
_create_object
(
Project
,
**
kwargs
)
project
=
_create_object
(
Project
,
**
kwargs
)
project
.
accept_member
(
self
.
owner
,
approval_user
)
project
.
accept_member
(
self
.
owner
,
approval_user
)
precursor
=
None
p
=
precursor
while
p
:
p
.
state
=
REPLACED
p
.
save
()
p
=
p
.
precursor_application
self
.
state
=
APPROVED
self
.
state
=
APPROVED
self
.
save
()
self
.
save
()
...
@@ -1453,7 +1442,7 @@ class Project(models.Model):
...
@@ -1453,7 +1442,7 @@ class Project(models.Model):
rejected
=
self
.
sync
()
rejected
=
self
.
sync
()
if
not
rejected
:
if
not
rejected
:
self
.
termination_start_date
=
None
self
.
termination_start_date
=
None
self
.
terminaton_date
=
datetime
.
now
()
self
.
terminat
i
on_date
=
datetime
.
now
()
self
.
save
()
self
.
save
()
notification
=
build_notification
(
notification
=
build_notification
(
...
@@ -1759,6 +1748,6 @@ def check_auto_accept_join_membership_policy(sender, instance, created, **kwargs
...
@@ -1759,6 +1748,6 @@ def check_auto_accept_join_membership_policy(sender, instance, created, **kwargs
if
not
created
:
if
not
created
:
return
return
join_policy
=
instance
.
project
.
application
.
definition
.
member_join_policy
join_policy
=
instance
.
project
.
application
.
definition
.
member_join_policy
if
join_policy
==
get_auto_accept_join
():
if
join_policy
==
get_auto_accept_join
()
and
not
instance
.
acceptance_date
:
instance
.
accept
()
instance
.
accept
()
post_save
.
connect
(
check_auto_accept_join_membership_policy
,
sender
=
ProjectMembership
)
post_save
.
connect
(
check_auto_accept_join_membership_policy
,
sender
=
ProjectMembership
)
\ No newline at end of file
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