[damned-lies] Also set default category name for branch without release



commit 176929019abde935d8a1d1525578af3ebd8a8f09
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Sep 15 21:19:37 2009 +0200

    Also set default category name for branch without release

 stats/forms.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/stats/forms.py b/stats/forms.py
index 406dfbb..8fb7bd4 100644
--- a/stats/forms.py
+++ b/stats/forms.py
@@ -28,7 +28,8 @@ class ModuleBranchForm(forms.Form):
                 # Branch is not linked to any release
                 self.fields[branch.name] = ReleaseField(queryset=Release.objects.all(),
                                                         label=branch.name)
-                self.fields[branch.name+'_cat'] = forms.ChoiceField(choices=CATEGORY_CHOICES)
+                self.fields[branch.name+'_cat'] = forms.ChoiceField(choices=CATEGORY_CHOICES,
+                                                                    initial=default_cat_name)
                 self.branch_fields.append((branch.name, branch.name+'_cat'))
 
         self.fields['new_branch'] = forms.CharField(required=False)



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