[damned-lies] Allow coordinators to mark translators as inactive (Fixes #634130)



commit aa37623dfbba3e94b38212605e8cdaaaa31dfc1b
Author: Adorilson Bezerra <adorilson gmail com>
Date:   Sat Feb 12 22:13:21 2011 +0100

    Allow coordinators to mark translators as inactive (Fixes #634130)

 teams/forms.py |    1 +
 teams/views.py |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/teams/forms.py b/teams/forms.py
index 8a0c343..fccbde8 100644
--- a/teams/forms.py
+++ b/teams/forms.py
@@ -18,6 +18,7 @@ class EditMemberRoleForm(forms.Form):
     def __init__(self, roles, *args, **kwargs):
         super(EditMemberRoleForm, self).__init__(*args, **kwargs)
         choices = list(filter(lambda x:x[0]!='coordinator', ROLE_CHOICES))
+        choices.append(('inactivate', _("Mark as Inactive")))
         choices.append(('remove', _("Remove From Team")))
         for role in roles:
             self.fields[str(role.pk)] = forms.ChoiceField(
diff --git a/teams/views.py b/teams/views.py
index 9d90108..1c25e2c 100644
--- a/teams/views.py
+++ b/teams/views.py
@@ -98,6 +98,9 @@ def team(request, team_slug):
                         role = Role.objects.get(pk=key)
                         if form_value == "remove":
                             role.delete()
+                        elif form_value == "inactivate":
+                            role.is_active = False
+                            role.save()
                         else:
                             role.role = form_value
                             role.save()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]