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

Refactor tcms.testcases.views.plan_from_request_or_none method #303

Closed
asankov opened this issue Apr 7, 2018 · 1 comment
Closed

Refactor tcms.testcases.views.plan_from_request_or_none method #303

asankov opened this issue Apr 7, 2018 · 1 comment

Comments

@asankov
Copy link
Member

asankov commented Apr 7, 2018

Currently, this method accepts both GET and POST request. We need to examine carefully whether this is the desired functionality.

Also, the current implementation returns either TestPlan object, an id or None. In my opinion, returning just the id is useless, because if you need just the id you can get it directly from the request, without calling this method. Moreover, this functionality (that returns just the id) is used at only one place. This means we can easily remove it from the method.

@asankov
Copy link
Member Author

asankov commented Dec 29, 2019

Currently, this method accepts both GET and POST request. We need to examine carefully whether this is the desired functionality.

This method is called 6 times. At least 1 is GET and at least 1 is POST, so this behavior must be kept for now.

Also, the current implementation returns either TestPlan object, an id or None.

This has been refactored and now it is now returning either None or a TestPlan object.

I am closing this, because I think this method cannot be simplified further.

@asankov asankov closed this as completed Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant