OpenSlides/openslides/users/projector.py
Oskar Hahn 6abb0976c2 Change system for autoupdate on the projector (#2394)
* Second websocket channel for the projector

* Removed use of projector requirements for REST API requests.

Refactored data serializing for projector websocket connection.

* Refactor the way that the projector autoupdate get its data.

* Fixed missing assignment slide title for hidden items.

* Release all items for item list slide and list of speakers slide. Fixed error with motion workflow.

* Created CollectionElement class which helps to handle autoupdate.
2016-09-17 22:26:23 +02:00

24 lines
664 B
Python

from ..core.exceptions import ProjectorException
from ..utils.projector import ProjectorElement
from .models import User
class UserSlide(ProjectorElement):
"""
Slide definitions for User model.
"""
name = 'users/user'
def check_data(self):
if not User.objects.filter(pk=self.config_entry.get('id')).exists():
raise ProjectorException('User does not exist.')
def get_requirements(self, config_entry):
try:
user = User.objects.get(pk=config_entry.get('id'))
except User.DoesNotExist:
# User does not exist. Just do nothing.
pass
else:
yield user