Merge pull request #4641 from normanjaeckel/FixMotionStateCreation

Server should not require restriction field for motion state. Fixed #…
This commit is contained in:
Emanuel Schütze 2019-04-28 13:46:21 +02:00 committed by GitHub
commit 483d759c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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