Commit 90e5b3ce authored by Sofia Papagiannaki's avatar Sofia Papagiannaki

Allow follower application with same deifinition name approvement

parent 3a1c2a0d
......@@ -50,10 +50,10 @@ class Command(NoArgsCommand):
)
def handle_noargs(self, **options):
apps = ProjectApplication.objects.select_related().all()
apps = ProjectApplication.objects.select_related().all().order_by('id')
labels = (
'application.id', 'project.id', 'name', 'application.state',
'application.id', 'application.state', 'project.id', 'name',
'is_active', 'is_alive', 'is_suspended', 'is_terminated'
)
columns = (15, 10, 20, 10, 10, 10, 10, 10)
......@@ -79,9 +79,9 @@ class Command(NoArgsCommand):
is_terminated = ''
fields = (
str(app.id),
app.state,
str(project_id),
app.definition.name,
app.state,
format_bool(is_active),
format_bool(is_alive),
format_bool(is_suspended),
......
......@@ -138,7 +138,7 @@ NOT_ALIVE_PROJECT = 'Project %(id)s is not alive.'
NOT_ALLOWED = 'You do not have the permissions to perform this action.'
MEMBER_NUMBER_LIMIT_REACHED = 'Maximum participant number has been reached.'
MEMBER_JOIN_POLICY_CLOSED = 'The project member join policy is cloesd.'
MEMBER_LEAVE_POLICY_CLOSED = 'The project member leave policy is cloesd.'
MEMBER_LEAVE_POLICY_CLOSED = 'The project member leave policy is closed.'
NOT_MEMBERSHIP_REQUEST = 'There is no such a membership request.'
MEMBERSHIP_REQUEST_EXISTS = 'There is alreary such a membership request.'
NO_APPLICANT = 'Project application requires an applicant. None found.'
......
......@@ -1151,12 +1151,12 @@ class ProjectDefinition(models.Model):
"""
Validate name uniqueness among all active projects.
"""
alive_projects = list(get_alive_projects())
q = filter(
lambda p: p.definition.name == self.name and \
p.application.id != self.projectapplication.id,
alive_projects
)
q = list(get_alive_projects())
q = filter(lambda p: p.definition.name == self.name , q)
q = filter(lambda p: p.application.id != self.projectapplication.id, q)
if self.projectapplication.precursor_application:
q = filter(lambda p: p.application.id != \
self.projectapplication.precursor_application.id, q)
if q:
raise ValidationError(
_(astakos_messages.UNIQUE_PROJECT_NAME_CONSTRAIN_ERR)
......
......@@ -86,6 +86,7 @@
<th>Ends</th>
<th>Enrolled</th>
<th>Status</th>
<th/>
<th>Membership Status</th>
<th>&nbsp;</th>
<th>Member accept policy</th>
......@@ -106,8 +107,9 @@
<td style="width:13%">{{o.definition.end_date|date:"d/m/Y"}}</td>
<td style="width:11%">{{approved_members|length}}</td>
<td style="width:11%">
{{o.state}}{% if o.state != 'Replaced' %}<a href="{% url project_update o.id %}">Update</a>{% endif %}
{{o.state}}
</td>
<td>{% if o.state != 'Replaced' %}<a href="{% url project_update o.id %}">Update</a>{% endif %}</td>
<td style="width:17%">
<div class="msg-wrap">
{% if user == o.owner %}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment