This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new f2d93d19a autopep8
f2d93d19a is described below
commit f2d93d19a1665407b2125f13f53be59b881d74cb
Author: Dave Brondsema <[email protected]>
AuthorDate: Thu Jun 4 11:43:12 2026 -0400
autopep8
---
Allura/allura/controllers/auth.py | 1 +
Allura/allura/lib/plugin.py | 2 +-
Allura/allura/lib/widgets/forms.py | 1 +
Allura/allura/model/repository.py | 2 +-
Allura/allura/scripts/scripttask.py | 1 +
Allura/allura/tests/functional/test_auth.py | 4 ++--
Allura/allura/tests/model/test_notification.py | 5 ++---
Allura/allura/tests/test_diff.py | 1 -
Allura/allura/tests/test_helpers.py | 4 ++++
Allura/allura/tests/test_patches.py | 2 ++
10 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/Allura/allura/controllers/auth.py
b/Allura/allura/controllers/auth.py
index e2fec3254..be741aaa1 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -1227,6 +1227,7 @@ def remove_webpage(self, **kw):
flash('Your personal contacts were successfully updated!')
redirect('.')
+
class UserAvailabilityController(BaseController):
def _check_security(self):
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index bcd03109e..ac21d66df 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -237,7 +237,7 @@ def login(self, user: M.User = None, multifactor_success:
bool = False, email_ve
return None
# All stages complete — clean up and proceed to login
- skip_after_login = self.session.get('mode') == 'email_code' # if we
used an email link we'll skip `after_login` which sends a foreign login email
+ skip_after_login = self.session.get('mode') == 'email_code' # if we
used an email link we'll skip `after_login` which sends a foreign login email
self.session.pop('multifactor-username', None)
self.session.pop('mode', None)
diff --git a/Allura/allura/lib/widgets/forms.py
b/Allura/allura/lib/widgets/forms.py
index 2d0e38391..cb48c535e 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -377,6 +377,7 @@ def display(self, **kw):
self.fields['newwebsite'].attrs['value'] = initial_value
return super(ForgeForm, self).display(**kw)
+
class RemoveTextValueForm(ForgeForm):
defaults = dict(ForgeForm.defaults, submit_text=None, show_errors=False)
diff --git a/Allura/allura/model/repository.py
b/Allura/allura/model/repository.py
index 9f321c841..23305db25 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -562,7 +562,7 @@ def init_as_clone(self, source_path, source_name,
source_url, bypass_path_check_
if not source_path.startswith(repos_root) and not
bypass_path_check_for_tests:
err = 'Invalid source path'
if asbool(tg.config['debug']) or 'pytest' in sys.modules:
- err += f': {source_path} must start with {repos_root}'
+ err += f': {source_path} must start with {repos_root}'
raise ValueError(err)
source = source_path
else:
diff --git a/Allura/allura/scripts/scripttask.py
b/Allura/allura/scripts/scripttask.py
index 61e7f02b0..4f3e825ce 100644
--- a/Allura/allura/scripts/scripttask.py
+++ b/Allura/allura/scripts/scripttask.py
@@ -128,6 +128,7 @@ def __doc__(cls):
pass
return stderr.getvalue()
+
class DefOptScriptTask(metaclass=MetaDefOpt):
"""Base class for a command-line script that is also executable as a
task."""
diff --git a/Allura/allura/tests/functional/test_auth.py
b/Allura/allura/tests/functional/test_auth.py
index 99934a308..85825af98 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -279,8 +279,8 @@ def test_auth_redirect_attack(self):
def test_evil_payloads(self):
payloads = ["https://evil.com", "//evil.com", r"\\evil.com", #
backslash variant (sometimes normalized oddly)
- "/\\evil.com", "///evil.com", "////evil.com", "https:evil.com", #
weird scheme parsing in some libs
- "http://evil.com", ]
+ "/\\evil.com", "///evil.com", "////evil.com",
"https:evil.com", # weird scheme parsing in some libs
+ "http://evil.com", ]
base = "http://localhost"
base_split = urlparse(base)
for p in payloads:
diff --git a/Allura/allura/tests/model/test_notification.py
b/Allura/allura/tests/model/test_notification.py
index f104ce6fd..8fecb7dbc 100644
--- a/Allura/allura/tests/model/test_notification.py
+++ b/Allura/allura/tests/model/test_notification.py
@@ -289,7 +289,7 @@ def test_footer(self):
[('',
'src="https://static.vecteezy.com/system/'),
('[link text](https://example.com)',
'href="https://example.com"'),
- ])
+ ])
def test_email_markdown_not_parsed(self, markdown, result):
"""
strings like `` in Wiki notification body should be
converted to HTML
@@ -345,7 +345,7 @@ def setup_with_tools(self):
ThreadLocalODMSession.flush_all()
@pytest.mark.parametrize('markdown, rendered_snippet',
-
[('',
'<img',), ('[link text](https://example.com)', '<a',), ])
+
[('',
'<img',), ('[link text](https://example.com)', '<a',), ])
def test_ticket_email_markdown_not_parsed(self, markdown,
rendered_snippet):
self._subscribe()
body_link = '[main link](https://wesbite.com)'
@@ -382,7 +382,6 @@ def _post_notification(self, **kwargs):
return M.Notification.post(self.pg, 'metadata', **kwargs)
-
class TestSubscriptionTypes:
def setup_method(self, method):
diff --git a/Allura/allura/tests/test_diff.py b/Allura/allura/tests/test_diff.py
index b22f2e809..cf5ba6f35 100644
--- a/Allura/allura/tests/test_diff.py
+++ b/Allura/allura/tests/test_diff.py
@@ -137,4 +137,3 @@ def test_make_table_with_html_tags(self):
assert 'file <a>' not in html
assert 'file <b>' in html
assert 'file <b>' not in html
-
diff --git a/Allura/allura/tests/test_helpers.py
b/Allura/allura/tests/test_helpers.py
index b442842d1..a41f39944 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -271,6 +271,7 @@ def test_render_any_markup_plain():
'readme.txt', '<b>blah</b>\n<script>alert(1)</script>\nfoo') ==
'<pre><b>blah</b>\n<script>alert(1)</script>\nfoo</pre>')
+
def test_render_any_markup_plain_code_mode_inline():
assert (
h.render_any_markup(
@@ -281,6 +282,7 @@ def test_render_any_markup_plain_code_mode_inline():
'<script>alert(1)</script></span><span id="l3"
class="code_block"><span class="lineno">3</span> '
'foo</span></pre></div>')
+
def test_render_any_markup_plain_code_mode_table():
assert (
h.render_any_markup(
@@ -293,6 +295,7 @@ def test_render_any_markup_plain_code_mode_table():
'</span><span id="l3"
class="code_block">foo</span></pre></div></td></tr></tbody></table>'
)
+
def test_render_any_markup_formatting():
assert (str(h.render_any_markup('README.md', '### foo\n'
' <script>alert(1)</script>bar')) ==
@@ -301,6 +304,7 @@ def test_render_any_markup_formatting():
'<script></span>alert(1)<span class="nt">'
'</script></span>bar\n</code></pre></div>\n</div>')
+
def test_render_any_markup_rst():
assert (str(h.render_any_markup('README.rst',
'foo\n===\n\nbar\n<script>alert(1)</script>')) ==
'<div class="document">\n'
diff --git a/Allura/allura/tests/test_patches.py
b/Allura/allura/tests/test_patches.py
index 281afada2..59ce2b02d 100644
--- a/Allura/allura/tests/test_patches.py
+++ b/Allura/allura/tests/test_patches.py
@@ -49,6 +49,7 @@ def test_with_trailing_slash_qs():
tg.decorators.with_trailing_slash(empty_func)()
assert raised.value.location == 'http://localhost/foo/bar/?foo=bar&baz=bam'
+
@patch.object(patches, 'request', webob.Request.blank('/foo/bar',
method='HEAD'))
def test_with_trailing_head():
patches.apply()
@@ -79,6 +80,7 @@ def test_without_trailing_slash_qs():
tg.decorators.without_trailing_slash(empty_func)()
assert raised.value.location == 'http://localhost/foo/bar?foo=bar&baz=bam'
+
@patch.object(patches, 'request', webob.Request.blank('/foo/bar/',
method='HEAD'))
def test_without_trailing_slash_head():
patches.apply()