anitab-org / anitab-org/mentorship-backend

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

オープン
#1,065 コメント 11 件 リアクション 0 件 担当者 1 名 @aakankshaagr が担当を希望しています GitHub で見る
Category: Coding Type: Enhancement
主要言語
Python
スター
200
フォーク
449
PR マージ指標
30日以内にマージされた PR はありません

説明

## 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。