Skip to content

Commit

Permalink
[#158458376]: Refactor validity check
Browse files Browse the repository at this point in the history
  • Loading branch information
slobodan-ilic committed Jun 25, 2018
1 parent bddc626 commit deccae3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cr/cube/subtotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ def is_valid(self):
if isinstance(self._data, dict):
required_keys = {'anchor', 'args', 'function', 'name'}
has_keys = set(self._data.keys()) == required_keys
if has_keys:
is_subtotal = self._data['function'] == 'subtotal'
hs_ids = self._data['args']
are_hs_ids_valid = self._validate_hs_ids(hs_ids)
return is_subtotal and are_hs_ids_valid
if has_keys and self._data['function'] == 'subtotal':
return self._validate_hs_ids(self._data['args'])
return False

@lazyproperty
Expand Down

0 comments on commit deccae3

Please sign in to comment.