1969416e64
Also added the derective osPerms to check if the current user has permissions. Removed old Django views and urls for user. Created utils.views.APIView which should be used instead of the AjaxView. Fixes: #1470 Fixes: #1454
25 lines
648 B
Python
25 lines
648 B
Python
from django.utils.translation import ugettext_lazy
|
|
|
|
from openslides.utils.widgets import Widget
|
|
|
|
from .models import User
|
|
|
|
|
|
class UserWidget(Widget):
|
|
"""
|
|
Provides a widget with all users. This is for short activation of
|
|
user slides.
|
|
"""
|
|
name = 'user'
|
|
verbose_name = ugettext_lazy('Users')
|
|
required_permission = 'core.can_manage_projector'
|
|
default_column = 1
|
|
default_weight = 60
|
|
default_active = False
|
|
template_name = 'users/widget_user.html'
|
|
|
|
def get_context_data(self, **context):
|
|
return super(UserWidget, self).get_context_data(
|
|
users=User.objects.all(),
|
|
**context)
|