Commit 67eb9903 authored by Staś Kycia's avatar Staś Kycia
Browse files

issuing local cards bug fix

parent 5c56d434
Loading
Loading
Loading
Loading
+4 −2
Changes for hybrid/admin.py: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -40,10 +40,12 @@ class IssueCardAdmin(admin.ModelAdmin):
    change_list_template = 'admin/issue_card_list.html'

    def changelist_view(self, request, extra_context = None):
        extra_context = extra_context or {}
        if not Election.objects.filter(is_hybrid=True).exists():
            messages.info(request, 'Utwórz głosowanie hybrydowe, aby wydawać karty')
            return HttpResponseRedirect(reverse('admin:elections_election_changelist'))
        
        extra_context = extra_context or {}
        extra_context['title'] = 'Wydawanie kart'
        
        return super().changelist_view(request, extra_context)
    
    def get_search_results(self, request, queryset, search_term):
+2 −2
Changes for hybrid/models.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,5 +12,5 @@ class IssueCards(Voter):
class EnterVotes(Election):
    class Meta:
        proxy = True
        verbose_name = 'Wprowadź głosy stacjonarne'
        verbose_name_plural = 'Wprowadź głosy stacjonarne'
 No newline at end of file
        verbose_name = 'Głos stacjonarny'
        verbose_name_plural = 'Głosy stacjonarne'
 No newline at end of file