Skip to content

Commit

Permalink
Handle if a mode is not passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
eheinrich committed Sep 4, 2019
1 parent 3c13807 commit c683618
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions observation_portal/observations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ def validate(self, data):

# Also check the guide and acquisition cameras are valid if specified
# But only if the guide mode is set
if (configuration['guiding_config']['mode'] != GuidingConfig.OFF or
configuration['acquisition_config']['mode'] != AcquisitionConfig.OFF):
if (
configuration['guiding_config'].get('mode', GuidingConfig.OFF) != GuidingConfig.OFF or
configuration['acquisition_config'].get('mode', AcquisitionConfig.OFF) != AcquisitionConfig.OFF
):
if not configuration.get('guide_camera_name', ''):
if (
'extra_params' in configuration
Expand Down

0 comments on commit c683618

Please sign in to comment.