Merge pull request #2873 from normanjaeckel/MotionCommentProtection

Fixed bug in relation for motion comment. Fixed #2568.
This commit is contained in:
Emanuel Schütze 2017-01-15 12:27:17 +01:00 committed by GitHub
commit befff17969
2 changed files with 2 additions and 1 deletions

View File

@ -230,7 +230,7 @@ angular.module('OpenSlidesApp.core', [
var Resource = DS.definitions[collection];
if (Resource.relationList) {
Resource.relationList.forEach(function (relationDef) {
if (relationDef.foreignKey) {
if (relationDef.foreignKey && !relationDef.osProtectedRelation) {
var query = {};
query[relationDef.foreignKey] = instance[Resource.idAttribute];
Resource.getResource(relationDef.relation).ejectAll(query);

View File

@ -36,6 +36,7 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
'motions/motion': {
localField: 'motions',
foreignKey: 'motion_block_id',
osProtectedRelation: true,
}
},
}