diff options
author | Andrew Donnellan <andrew.donnellan@au1.ibm.com> | 2017-12-19 16:41:27 +1100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2018-01-04 11:29:58 +0000 |
commit | 14034e8a44a497d32f56f31a0fdc4473336d92af (patch) | |
tree | be563f3cd93471f7a6f92d92cec3415d67e54dce /tools | |
parent | 8ac8e7a618e0c94a7d2c9aacb3c005949b3cb694 (diff) | |
download | patchwork-14034e8a44a497d32f56f31a0fdc4473336d92af.tar patchwork-14034e8a44a497d32f56f31a0fdc4473336d92af.tar.gz |
views: Don't render token section of user profile if REST API disabled
In profile.html, if settings.ENABLE_REST_API == False, trying to render a
link to the generate_token page will raise a NoReverseMatch exception, so
we shouldn't render that. In any case, if the REST API is disabled, we
really shouldn't render the API token section of the page at all.
Only render the API token and generation link if settings.ENABLE_REST_API
is True.
Reported-by: Tomas Novotny <tomas@novotny.cz>
Closes: #138 ("NoReverseMatch exception on user login with disabled REST API")
Fixes: 85c8f369204a ("views: Provide a way to view, (re)generate tokens")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions