Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mentioned changes in resources files to follow the same convention #898

Open
4 tasks
PrashanthPuneriya opened this issue Sep 26, 2020 · 5 comments
Open
4 tasks
Assignees
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner.

Comments

@PrashanthPuneriya
Copy link
Contributor

Description

As a contributor,
I need consistent style followed in resources file,
so that I don't get confused that whether some part of the code is missing or not.

Mocks

@users_ns.response(HTTPStatus.CREATED, "%s" % messages.PASSWORD_SUCCESSFULLY_UPDATED)
@users_ns.response(HTTPStatus.BAD_REQUEST, "%s" % messages.USER_ENTERED_INCORRECT_PASSWORD)
@users_ns.response(
HTTPStatus.UNAUTHORIZED,
"%s\n%s\n%s"
% (
messages.TOKEN_HAS_EXPIRED,
messages.TOKEN_IS_INVALID,
messages.AUTHORISATION_TOKEN_IS_MISSING,
),
)
@users_ns.route("user/change_password")

Here the route is below the responses which breaks the convention.
@users_ns.route("register")
class UserRegister(Resource):
@classmethod
@users_ns.doc("create_user")
@users_ns.response(HTTPStatus.CREATED, "%s" % messages.USER_WAS_CREATED_SUCCESSFULLY)
@users_ns.response(
HTTPStatus.BAD_REQUEST,
"%s\n%s\n%s"
% (
messages.USERNAME_FIELD_IS_EMPTY,
messages.PASSWORD_INPUT_BY_USER_HAS_INVALID_LENGTH,
messages.EMAIL_INPUT_BY_USER_IS_INVALID
),
)
@users_ns.response(
HTTPStatus.CONFLICT,
"%s\n%s"
% (
messages.USER_USES_A_USERNAME_THAT_ALREADY_EXISTS,
messages.USER_USES_AN_EMAIL_ID_THAT_ALREADY_EXISTS
),
)

Here the responses aren't attached with the route function but with the put().

Acceptance Criteria

Update [Required]

  • Make the above mentioned changes in the code to follow the same convention throughout the file.
  • Check the same with other resources files and fix them if such convetion is broken.

Definition of Done

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

Estimation

4 hours

@PrashanthPuneriya PrashanthPuneriya added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Status: Available Issue was approved and available to claim or abandoned for over 3 days. labels Sep 26, 2020
@gitpurva
Copy link

Can I take up this issue?

@PrashanthPuneriya
Copy link
Contributor Author

Sure @gitpurva

@PrashanthPuneriya PrashanthPuneriya removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Sep 26, 2020
@PrashanthPuneriya
Copy link
Contributor Author

Any progress @gitpurva?

@gitpurva
Copy link

gitpurva commented Sep 28, 2020 via email

@devkapilbansal devkapilbansal added the Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner. label Feb 28, 2021
@devkapilbansal
Copy link
Member

devkapilbansal commented Feb 28, 2021

@isabelcosta putting this on hold as what needs to be done not seems to be clearly mentioned in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: On Hold Issue or PR needs more info, a discussion, a review or approval from a Maintainer/Code Owner.
Projects
None yet
4 participants