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

`use_args` does not use the parser's locations #44

Closed
jacebrowning opened this issue May 20, 2015 · 1 comment

Comments

@jacebrowning
Copy link
Contributor

commented May 20, 2015

If I specify custom locations in a parser:

parser = FlaskParser(locations=('data', 'query'))

@parser.location_handler('data')
def parse_data(req, name, arg):
    ...

Then decorate a method with use_args:

class WidgetList(MethodView):

    @parser.use_args(widget_args)
    def post(self, args):
    ...

Those custom locations are ignored and the default locations are used:

https://github.com/sloria/webargs/blob/f57c9b730d9b274edce85de38cdc39fdbdc2ecca/webargs/core.py#L445

This requires me to override locations in every use_args decorator:

    #                                v
    @parser.use_args(my_widget_args, locations=parser.locations)

Was this intentional? To me, it seems like line 445 in use_args should be:

locations = locations or self.locations
@sloria

This comment has been minimized.

Copy link
Member

commented May 21, 2015

This is indeed a bug. Thanks for the PR!

@sloria sloria closed this in #45 May 21, 2015

sloria added a commit that referenced this issue Sep 30, 2018

Bump sphinx-issues from 1.0.0 to 1.1.0 (#292)
Bumps [sphinx-issues](https://github.com/sloria/sphinx-issues) from 1.0.0 to 1.1.0.
<details>
<summary>Commits</summary>

- [`6a9da3a`](sloria/sphinx-issues@6a9da3a) Bump version and update changelog
- [`5b5259e`](sloria/sphinx-issues@5b5259e) Bring tox more in line with travis
- [`b4b36a3`](sloria/sphinx-issues@b4b36a3) Merge pull request [#44](https://github-redirect.dependabot.com/sloria/sphinx-issues/issues/44) from sloria/add-cve-role
- [`73b2090`](sloria/sphinx-issues@73b2090) Add :cve: role for linking to CVEs on Mitre
- [`cebf09a`](sloria/sphinx-issues@cebf09a) Bump invoke from 1.1.1 to 1.2.0
- [`7aaf7e7`](sloria/sphinx-issues@7aaf7e7) Bump tox from 3.2.1 to 3.3.0
- [`3c16b57`](sloria/sphinx-issues@3c16b57) Bump pytest from 3.7.4 to 3.8.0
- [`22b3146`](sloria/sphinx-issues@22b3146) Bump pytest from 3.7.3 to 3.7.4
- [`8169910`](sloria/sphinx-issues@8169910) Bump pytest from 3.7.2 to 3.7.3
- [`09272b3`](sloria/sphinx-issues@09272b3) Merge pull request [#38](https://github-redirect.dependabot.com/sloria/sphinx-issues/issues/38) from sloria/dependabot/pip/pytest-3.7.2
- Additional commits viewable in [compare view](sloria/sphinx-issues@1.0.0...1.1.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=sphinx-issues&package-manager=pip&previous-version=1.0.0&new-version=1.1.0)](https://dependabot.com/compatibility-score.html?dependency-name=sphinx-issues&package-manager=pip&previous-version=1.0.0&new-version=1.1.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

Dependabot will **not** automatically merge this PR because it includes a minor update to a production dependency.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.