KOSASIH / HealthGuard-Refugee-Initiative

Unnecessary else / elif used after return PYL-R1705
Style
Major
5 months ago5 months old
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 72    )
 73
 74    # Check if the request was successful
 75    if response.status_code == 201: 76        # If the device was integrated successfully, return True
 77        return True
 78    else:
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 48    )
 49
 50    # Check if the request was successful
 51    if response.status_code == 201: 52        # If the alert was sent successfully, return True
 53        return True
 54    else:
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it
 17    response = requests.get(f"https://api.healthguard.com/devices/{device_id}/data")
 18
 19    # Check if the request was successful
 20    if response.status_code == 200: 21        # Parse the JSON response
 22        data = json.loads(response.text)
 23