2013-12-03 01:50:10 +01:00
|
|
|
from django.utils.translation import ugettext_lazy
|
|
|
|
|
|
|
|
from openslides.utils.personal_info import PersonalInfo
|
|
|
|
|
2015-01-25 15:10:34 +01:00
|
|
|
from .models import Assignment, AssignmentRelatedUser
|
2013-12-03 01:50:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
class AssignmentPersonalInfo(PersonalInfo):
|
|
|
|
"""
|
|
|
|
Class for personal info block for the assignment app.
|
|
|
|
"""
|
|
|
|
headline = ugettext_lazy('I am candidate for the following elections')
|
|
|
|
default_weight = 40
|
|
|
|
|
|
|
|
def get_queryset(self):
|
2015-01-25 15:10:34 +01:00
|
|
|
return (Assignment.objects.filter(assignment_related_users__user=self.request.user)
|
|
|
|
.exclude(assignment_related_users__status=AssignmentRelatedUser.STATUS_BLOCKED))
|