Skip to content

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

Open
@codesankalp

Description

Description

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

Mocks

name = data["name"]
username = data["username"]
password = data["password"]
email = data["email"]
terms_and_conditions_checked = data["terms_and_conditions_checked"]

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

Metadata

Assignees

Labels

Category: CodingChanges to code base or refactored code that doesn't fix a bug.Type: EnhancementNew feature or request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions