Fixed bug in relation for motion comment. Fixed #2568.

This commit is contained in:
Norman Jäckel 2017-01-15 10:20:45 +01:00
parent 624fcc663b
commit f086d055b6
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,
}
},
}