Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-web
Commits
abcf13e2
Verified
Commit
abcf13e2
authored
1 month ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
api, inbound_email: Fix mypy 1.15 errors
parent
bb2eee75
No related branches found
Branches containing commit
Tags
v0.9.7
Tags containing commit
1 merge request
!1387
Apply swh-py-template-v0.3.3 with copier update
Pipeline
#13307
passed
1 month ago
Stage: external
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
swh/web/api/throttling.py
+2
-2
2 additions, 2 deletions
swh/web/api/throttling.py
swh/web/inbound_email/handle_message.py
+1
-1
1 addition, 1 deletion
swh/web/inbound_email/handle_message.py
swh/web/inbound_email/tests/test_utils.py
+2
-2
2 additions, 2 deletions
swh/web/inbound_email/tests/test_utils.py
with
5 additions
and
5 deletions
swh/web/api/throttling.py
+
2
−
2
View file @
abcf13e2
...
...
@@ -95,9 +95,9 @@ class SwhWebRateThrottle(ScopedRateThrottle):
def
allow_request
(
self
,
request
:
Request
,
view
:
APIView
)
->
bool
:
# class based view case
if
not
self
.
scope
:
default_scope
=
getattr
(
view
,
self
.
scope_attr
,
None
)
default_scope
=
getattr
(
view
,
self
.
scope_attr
,
""
)
request_allowed
=
None
if
default_scope
is
not
None
:
if
default_scope
:
# check if there is a specific rate limiting associated
# to the request type
assert
request
.
method
is
not
None
...
...
This diff is collapsed.
Click to expand it.
swh/web/inbound_email/handle_message.py
+
1
−
1
View file @
abcf13e2
...
...
@@ -20,7 +20,7 @@ class MessageHandler:
def
__init__
(
self
,
raw_message
:
bytes
,
sender
:
Optional
[
Type
]
=
None
):
try
:
self
.
message
=
email
.
message_from_bytes
(
raw_message
,
policy
=
email
.
policy
.
default
raw_message
,
policy
=
email
.
policy
.
default
# type: ignore[arg-type]
)
except
Exception
as
exc
:
sentry_capture_exception
(
exc
)
...
...
This diff is collapsed.
Click to expand it.
swh/web/inbound_email/tests/test_utils.py
+
2
−
2
View file @
abcf13e2
...
...
@@ -154,7 +154,7 @@ def test_recipient_matches_casemapping():
)
def
test_recipient_matches_real_world
(
filename
:
str
,
recipient
:
str
,
extension
:
str
):
with
open_binary
(
"
swh.web.inbound_email.tests.resources
"
,
filename
)
as
f
:
message
=
email
.
message_from_binary_file
(
f
,
policy
=
email
.
policy
.
default
)
message
=
email
.
message_from_binary_file
(
f
,
policy
=
email
.
policy
.
default
)
# type: ignore[arg-type]
assert
isinstance
(
message
,
EmailMessage
)
...
...
@@ -400,7 +400,7 @@ def test_get_message_plaintext(
filename
:
str
,
expected_parts
:
List
[
str
],
expected_absent
:
List
[
str
]
):
with
open_binary
(
"
swh.web.inbound_email.tests.resources
"
,
filename
)
as
f
:
message
=
email
.
message_from_binary_file
(
f
,
policy
=
email
.
policy
.
default
)
message
=
email
.
message_from_binary_file
(
f
,
policy
=
email
.
policy
.
default
)
# type: ignore[arg-type]
assert
isinstance
(
message
,
EmailMessage
)
...
...
This diff is collapsed.
Click to expand it.
Antoine Lambert
@anlambert
mentioned in merge request
!1377 (closed)
·
3 days ago
mentioned in merge request
!1377 (closed)
mentioned in merge request !1377
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment