You can probably just do `if sID:` here. Or, better yet, combine it with the next line:

```python
if not (sID and sID in [s['service_code'] for s in services_list]):
    sID = ''
```

or even just:

```python
if sID not in [s['service_code'] for s in services_list]:
    sID = ''
```

Since it probably doesn't matter *what* sID was if it wasn't a valid service.