Mentorship-backend: Use f-strings on Mentorship Relation Resources file

Created on 23 Aug 2020  路  15Comments  路  Source: anitab-org/mentorship-backend

Description

As a developer,
I need change strings interpolation in User Resources file,
so that I can make that file follow Coding Standards.

Format strings using f-strings when appropriate for app/api/resources/mentorship_relation.py file.

Mocks

As an example, here:

https://github.com/anitab-org/mentorship-backend/blob/9102175e85302a04ad4d3bc4d1f89f30f840b0f9/app/api/resources/mentorship_relation.py#L148-L152

We can use f-strings in this example.

Acceptance Criteria

Update [Required]

  • [ ] Update all string instances to use f-string, when applicable for app/api/resources/mentorship_relation.py file

Definition of Done

  • [ ] All of the required items are completed.
  • [x] Approval by 1 mentor.

Estimation

0.5 hours

Coding First Timers Only Enhancement

All 15 comments

Hey! I would like to work on this issue.. May I?

Yes sure @pavani-17 :) I will assign this to you!

Hey! I was making some changes and I am not sure if I messed up my previous PR. I am really sorry for the inconvenience, but could you please let me know if the previous PR is fine. TIA

Hi everyone! Is it ok if I work on this issue please?

@LucasSD try asking it on zulip

@devkapilbansal thank you. I've mentioned it in the newcomers stream.

@devkapilbansal @isabelcosta I think that the PR #976 already contains this and also cause of refactoring, this issue has no effect.

@LucasSD I have taken a look and it was sort of fixed with the refactor.
File: https://github.com/anitab-org/mentorship-backend/blob/develop/app/api/resources/mentorship_relation.py

However, I see this line #L57, where f string is defined 2 times in the same line, perhaps that could be one f-string only. If you see any improvement to be made in this file with regards to f string I am happy to assign this to you.

@isabelcosta yes please assign to me and I'll make that small change and check through the file for anything else. Thanks

@LucasSD I just assigned this to you :)

@isabelcosta Thank you, I'll get this done next week

@isabelcosta I've made a couple of small changes as requested. Would it be worthwhile changing the below to f-strings too?

https://github.com/LucasSD/mentorship-backend/blob/5386228ecf17602fc196f62e17b7c3284acd1705/app/api/resources/mentorship_relation.py#L109-L117

No, @LucasSD f-strings are required only when there is a variable with strings.

P.S. :- Giving an extra blank line between text and link will show the preview of line too

@devkapilbansal No worries, I'll create the pull request later. Thank you for the tip!

@devkapilbansal thank you for helping here 馃槃 Kapil is correct here @LucasSD :)
Looking forward to seeing your pull request :)

Was this page helpful?
0 / 5 - 0 ratings