anitab-org / anitab-org/bridge-in-tech-backend

Improvement: Refactor code to use dict.get() method

Offen
#242 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Category: Coding hacktoberfest Status: Available Type: Enhancement
Vorherrschende Sprache
Python
Sterne
24
Forks
80
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Description
As a developer,
I need code to be consistent and error-free.

## Mocks
https://github.com/anitab-org/bridge-in-tech-backend/blob/68d8ff9a8640cef1d3e53b2b0dd9b80e3d750fd7/app/api/validations/organization.py#L32-L34
For example this can be replaced by the get method i.e. data.get("KEY", "DEFAULT_VALUE") to avoid KeyError

## Acceptance Criteria
### Update [Required]
- [ ] Use get method in all code to avoid the raise of KeyError.
- [ ] Handle exceptions for default value.

## Definition of Done
- [ ] All of the required items are completed.
- [ ] Approval by 1 mentor.

## Estimation
2 hours

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.