Server should not require restriction field for motion state. Fixed #4622.

This commit is contained in:
Norman Jäckel 2019-04-27 16:23:31 +02:00
parent 0675bdcf46
commit 3d6e87e1ef
2 changed files with 1 additions and 3 deletions

View File

@ -95,8 +95,6 @@ export class WorkflowRepositoryService extends BaseRepository<ViewWorkflow, Work
public async addState(stateName: string, viewWorkflow: ViewWorkflow): Promise<void> {
const newStatePayload = {
name: stateName,
// TODO: The server requires a string-array of restrictions. Should really not be necessary
restriction: [],
workflow_id: viewWorkflow.id
};
await this.httpService.post(this.restStateUrl, newStatePayload);

View File

@ -96,7 +96,7 @@ class StateSerializer(ModelSerializer):
Serializer for motion.models.State objects.
"""
restriction = JSONField()
restriction = JSONField(required=False)
class Meta:
model = State