Skip to content

Commit

Permalink
Update name for validating activity status
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachinbisht27 committed Jul 17, 2024
1 parent e707480 commit 6860a86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/helpers/common_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def get_current_utc_timestamp() -> datetime:
return datetime.now(timezone.utc)


def check_activity_key(activity_key: str, keyword: str, status: str):
def validate_activity_status(activity_key: str, keyword: str, status: str):
return (
True
if activity_key.startswith(keyword) and activity_key.endswith(status)
Expand Down
6 changes: 3 additions & 3 deletions api/services/user_activities_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def handle_user_activities(self, json_data: dict[str, Any]):
def create_or_update_user_activity(
self, activity_key: str, current_time: datetime
) -> Optional[models.UserActivities]:
is_started = common_helper.check_activity_key(
is_started = common_helper.validate_activity_status(
activity_key, "activity_", "_started"
)
is_succeeded = common_helper.check_activity_key(
is_succeeded = common_helper.validate_activity_status(
activity_key, "activity_", "_success"
)
is_completed = common_helper.check_activity_key(
is_completed = common_helper.validate_activity_status(
activity_key, "activity_", "_completed"
)

Expand Down

0 comments on commit 6860a86

Please sign in to comment.