Skip to content

Commit

Permalink
Use succinct syntax when checking backport label
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
  • Loading branch information
lcarva authored and yashvardhannanavati committed Jun 24, 2020
1 parent 11c4de8 commit c01056e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions iib/web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,8 @@ def from_json(cls, kwargs):
if not isinstance(request_kwargs[param], str):
raise ValidationError(f'"{param}" must be a string')

if 'force_backport' in request_kwargs:
if not isinstance(request_kwargs['force_backport'], bool):
raise ValidationError('"force_backport" must be a boolean')
if not isinstance(request_kwargs.get('force_backport', False), bool):
raise ValidationError('"force_backport" must be a boolean')

# Remove attributes that are not stored in the database
request_kwargs.pop('cnr_token', None)
Expand Down

0 comments on commit c01056e

Please sign in to comment.