anitab-org / anitab-org/mentorship-backend

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

Abierto
#1,065 11 comentarios 0 reacciones 1 asignado Reclamado por @aakankshaagr Ver en GitHub
Category: Coding Type: Enhancement
Lenguaje dominante
Python
Estrellas
200
Forks
449
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

## Mocks
https://github.com/anitab-org/mentorship-backend/blob/d52d77706aad4a486f2417419bb4c4c6d2ace3a6/app/api/dao/user.py#L42-L46
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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.