Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SamR1 committed Nov 20, 2024
1 parent fe0a688 commit 4ebf02e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions fittrackee/tests/users/test_users_export_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ def test_it_returns_user_reply(
user_2, workout_cycling_user_1, text_visibility=PrivacyLevel.PUBLIC
)
comment = self.create_comment(
user_1, workout_cycling_user_1, text_visibility=PrivacyLevel.PUBLIC, parent_comment=parent_comment
user_1,
workout_cycling_user_1,
text_visibility=PrivacyLevel.PUBLIC,
parent_comment=parent_comment,
)
exporter = UserDataExporter(user_1)

Expand All @@ -258,7 +261,7 @@ def test_it_returns_user_reply(
'reply_to': parent_comment.short_id,
'text': comment.text,
'text_visibility': comment.text_visibility.value,
'workout_id': workout_cycling_user_1.short_id
'workout_id': workout_cycling_user_1.short_id,
},
]

Expand Down Expand Up @@ -288,6 +291,7 @@ def test_it_returns_user_comment_without_workout(
},
]


class TestUserDataExporterExportData:
def test_export_data_generates_json_file_in_user_directory(
self,
Expand Down
14 changes: 10 additions & 4 deletions fittrackee/users/export_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ def get_user_comments_data(self) -> List[Dict]:
'created_at': comment.created_at,
'id': comment.short_id,
'modification_date': comment.modification_date,
'reply_to': (comment.parent_comment.short_id if comment.reply_to else None),
'reply_to': (
comment.parent_comment.short_id
if comment.reply_to
else None
),
'text': comment.text,
'text_visibility': comment.text_visibility.value,
'workout_id': (comment.workout.short_id
if comment.workout_id
else None),
'workout_id': (
comment.workout.short_id
if comment.workout_id
else None
),
}
)
return comments_data
Expand Down

0 comments on commit 4ebf02e

Please sign in to comment.