[Oi-commits] r1493 - in trunk: forum poll

oi-commits at pardus.org.tr oi-commits at pardus.org.tr
Thu Jun 19 12:57:11 EEST 2008


Author: jnmbk
Date: Thu Jun 19 12:57:10 2008
New Revision: 1493

Modified:
   trunk/forum/views.py
   trunk/poll/models.py
Log:
disable changing poll type

Modified: trunk/forum/views.py
=================================================================
--- trunk/forum/views.py	(original)
+++ trunk/forum/views.py	Thu Jun 19 12:57:10 2008
@@ -795,15 +795,9 @@
     if request.method == 'POST':
         form = PollForm(request.POST.copy())
         if form.is_valid():
-            # we must delete existing votes in this case
-            #FIXME: Doesn't work because form.cleaned_data["allow_changing_vote"] always return True
-            print poll.allow_multiple_choices, form.cleaned_data["allow_changing_vote"], poll.allow_multiple_choices and not form.cleaned_data["allow_changing_vote"]
-            if poll.allow_multiple_choices and not form.cleaned_data["allow_changing_vote"]:
-                poll.pollvote_set.delete()
             # change the poll
             poll.question = form.cleaned_data["question"]
             poll.allow_changing_vote = form.cleaned_data["allow_changing_vote"]
-            poll.allow_multiple_choices = form.cleaned_data["allow_multiple_choices"]
             poll.date_limit = form.cleaned_data["date_limit"]
             poll.end_date = form.cleaned_data["end_date"]
             poll.save()

Modified: trunk/poll/models.py
=================================================================
--- trunk/poll/models.py	(original)
+++ trunk/poll/models.py	Thu Jun 19 12:57:10 2008
@@ -51,7 +51,7 @@
 class Poll(models.Model):
     question = models.CharField("Soru", max_length=128, help_text="Buraya anketin sorusunu yazın.")
     allow_changing_vote = models.BooleanField("Oy Değiştirmek İzinli", default=False, blank=True, help_text="Kullanılan oyların sonradan değiştirilebilmesini istiyorsanız bunu işaretleyin.")
-    allow_multiple_choices = models.BooleanField("Çok Seçmeli Oylama", default=False, blank=True, help_text="Bir kişinin birden fazla seçenekte oy kullanabilmesini isiyorsanız bunu seçin. Uyarı: Eğer seçiliyse ve sonradan kaldırılırsa o ana kadar verilen bütün oylar silinecektir.")
+    allow_multiple_choices = models.BooleanField("Çok Seçmeli Oylama", default=False, blank=True, help_text="Bir kişinin birden fazla seçenekte oy kullanabilmesini isiyorsanız bunu seçin. Uyarı: Bu ayarı sonradan değiştiremezsiniz.")
     date_limit = models.BooleanField("Süreli", help_text="Oylamada süre sınırı olmasını istiyorsanız bunu işaretleyin.")
     end_date = models.DateTimeField("Bitiş Tarihi", blank=True, null=True, help_text="Oylamanın ne zaman biteceğini belirleyin. 30/8/2008 gibi.")
 


More information about the Oi-commits mailing list