OpenSlides/openslides/users/projector.py

22 lines
539 B
Python
Raw Normal View History

from typing import Generator, Type
2015-09-16 00:55:27 +02:00
from ..core.exceptions import ProjectorException
from ..utils.projector import ProjectorElement
from .models import User
class UserSlide(ProjectorElement):
"""
Slide definitions for User model.
"""
2019-01-06 16:22:33 +01:00
name = "users/user"
def check_data(self):
2019-01-06 16:22:33 +01:00
if not User.objects.filter(pk=self.config_entry.get("id")).exists():
raise ProjectorException("User does not exist.")
def get_projector_elements() -> Generator[Type[ProjectorElement], None, None]:
yield UserSlide