Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Portal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
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
Fachschaft
Portal
Commits
4dcb6d31
Verified
Commit
4dcb6d31
authored
7 months ago
by
Jakob Moser
Browse files
Options
Downloads
Patches
Plain Diff
Use Optional, remove incorrect type
parent
59bbca69
No related branches found
No related tags found
1 merge request
!22
Make MyPy happy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
portal/model/UtcDateTime.py
+3
-3
3 additions, 3 deletions
portal/model/UtcDateTime.py
with
3 additions
and
3 deletions
portal/model/UtcDateTime.py
+
3
−
3
View file @
4dcb6d31
...
...
@@ -28,15 +28,15 @@ class UtcDateTime(types.TypeDecorator):
return
types
.
String
(
32
)
def
process_bind_param
(
self
,
value
:
datetime
|
None
,
dialect
:
Dialect
)
->
Optional
[
str
|
datetime
]:
self
,
value
:
Optional
[
datetime
]
,
dialect
:
Dialect
)
->
Optional
[
str
]:
if
value
is
None
:
return
None
return
value
.
astimezone
(
timezone
.
utc
).
isoformat
()
def
process_result_value
(
self
,
value
:
str
|
None
,
dialect
:
Dialect
self
,
value
:
Optional
[
str
]
,
dialect
:
Dialect
)
->
Optional
[
datetime
]:
if
value
is
None
:
return
None
...
...
This diff is collapsed.
Click to expand it.
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