diff --git a/openslides/motions/models.py b/openslides/motions/models.py index 302de06df..f46163b4e 100644 --- a/openslides/motions/models.py +++ b/openslides/motions/models.py @@ -591,6 +591,8 @@ class Motion(RESTModelMixin, models.Model): The message should be in English and translatable, e. g. motion.write_log(message_list=[ugettext_noop('Message Text')]) """ + if person and not person.is_authenticated(): + person = None MotionLog.objects.create(motion=self, message_list=message_list, person=person) def is_amendment(self): diff --git a/openslides/motions/serializers.py b/openslides/motions/serializers.py index 59494700e..babb7d13f 100644 --- a/openslides/motions/serializers.py +++ b/openslides/motions/serializers.py @@ -290,7 +290,7 @@ class MotionSerializer(ModelSerializer): motion.save() if validated_data.get('submitters'): motion.submitters.add(*validated_data['submitters']) - else: + elif validated_data['request_user'].is_authenticated(): motion.submitters.add(validated_data['request_user']) motion.supporters.add(*validated_data.get('supporters', [])) motion.attachments.add(*validated_data.get('attachments', [])) diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 9670933ae..35c6293f5 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -1321,6 +1321,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid '$state', 'gettext', 'gettextCatalog', + 'operator', 'Motion', 'MotionForm', 'Category', @@ -1331,7 +1332,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid 'Workflow', 'Agenda', 'AgendaUpdate', - function($scope, $state, gettext, gettextCatalog, Motion, MotionForm, Category, Config, Mediafile, Tag, User, Workflow, Agenda, AgendaUpdate) { + function($scope, $state, gettext, gettextCatalog, operator, Motion, MotionForm, Category, Config, Mediafile, Tag, User, Workflow, Agenda, AgendaUpdate) { Category.bindAll({}, $scope, 'categories'); Mediafile.bindAll({}, $scope, 'mediafiles'); Tag.bindAll({}, $scope, 'tags'); @@ -1364,11 +1365,14 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions', 'OpenSlid $scope.save = function (motion) { Motion.create(motion).then( function(success) { - // type: Value 1 means a non hidden agenda item, value 2 means a hidden agenda item, - // see openslides.agenda.models.Item.ITEM_TYPE. - var changes = [{key: 'type', value: (motion.showAsAgendaItem ? 1 : 2)}, - {key: 'parent_id', value: motion.agenda_parent_item_id}]; - AgendaUpdate.saveChanges(success.agenda_item_id, changes); + // change agenda item only if user has the permission to do that + if (operator.hasPerms('agenda.can_manage')) { + // type: Value 1 means a non hidden agenda item, value 2 means a hidden agenda item, + // see openslides.agenda.models.Item.ITEM_TYPE. + var changes = [{key: 'type', value: (motion.showAsAgendaItem ? 1 : 2)}, + {key: 'parent_id', value: motion.agenda_parent_item_id}]; + AgendaUpdate.saveChanges(success.agenda_item_id, changes); + } if (isAmendment) { $state.go('motions.motion.detail', {id: success.id}); } diff --git a/openslides/motions/static/templates/motions/motion-detail.html b/openslides/motions/static/templates/motions/motion-detail.html index 295326d9f..a3140cd31 100644 --- a/openslides/motions/static/templates/motions/motion-detail.html +++ b/openslides/motions/static/templates/motions/motion-detail.html @@ -398,11 +398,14 @@ -
-

Motion Comments

-
-

- {{ field.name }}: {{ motion.comments[$index] }} -

-
+
+

Motion Comments

+
+

+ {{ field.name }}: + internal +
+ {{ motion.comments[$index] }} +

+
diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index 88c413357..b635200bd 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -1311,6 +1311,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) gettext('Can create motions'); gettext('Can support motions'); gettext('Can manage motions'); + gettext('Can see and manage comments'); // users gettext('Can see names of users'); gettext('Can see extra data of users (e.g. present and comment)');