Allow follower application with same deifinition name approvement
authorSofia Papagiannaki <papagian@gmail.com>
Wed, 12 Dec 2012 09:22:29 +0000 (11:22 +0200)
committerSofia Papagiannaki <papagian@gmail.com>
Wed, 12 Dec 2012 09:22:29 +0000 (11:22 +0200)
snf-astakos-app/astakos/im/management/commands/project-list.py
snf-astakos-app/astakos/im/messages.py
snf-astakos-app/astakos/im/models.py
snf-astakos-app/astakos/im/templates/im/projects/project_list.html

index 841ca1b..4573341 100644 (file)
@@ -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),
index 3bff696..b31da17 100644 (file)
@@ -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.'
index 9dc39b7..1786618 100644 (file)
@@ -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)
index 893dee5..36e1de2 100644 (file)
@@ -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>
                            <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 %}