You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/06/08 11:14:13 UTC
[incubator-ponymail-foal] branch master updated: Fix branch and
date type bugs
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new cf28ca4 Fix branch and date type bugs
new ccacc6a Merge pull request #42 from sbp/branch-and-date-fixes
cf28ca4 is described below
commit cf28ca487a02cdf109a1084f412bd44f841c827c
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Tue Jun 8 11:42:08 2021 +0100
Fix branch and date type bugs
---
server/endpoints/oauth.py | 2 +-
server/plugins/messages.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/endpoints/oauth.py b/server/endpoints/oauth.py
index c3ecbda..c824b28 100644
--- a/server/endpoints/oauth.py
+++ b/server/endpoints/oauth.py
@@ -43,7 +43,7 @@ async def process(
rv = await plugins.oauthGoogle.process(indata, session, server)
# GitHub OAuth - Fetches name and email
- if indata.get("key", "") == "github" and code and server.config.oauth.github_client_id:
+ elif indata.get("key", "") == "github" and code and server.config.oauth.github_client_id:
rv = await plugins.oauthGithub.process(indata, session, server)
# Generic OAuth handler, only one we support for now. Works with ASF OAuth.
diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index 2319602..09b3911 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -432,7 +432,7 @@ async def get_years(session, query_defuzzed):
size=1,
body={"query": {"bool": query_defuzzed}, "sort": {"epoch": "asc"}},
)
- oldest = 1970
+ oldest = datetime.datetime.fromtimestamp(0)
if res["hits"]["hits"]:
doc = res["hits"]["hits"][0]
oldest = datetime.datetime.fromtimestamp(doc["_source"]["epoch"])
@@ -441,7 +441,7 @@ async def get_years(session, query_defuzzed):
res = await session.database.search(
size=1, body={"query": {"bool": query_defuzzed}, "sort": {"epoch": "desc"}}
)
- youngest = 1970
+ youngest = datetime.datetime.fromtimestamp(0)
if res["hits"]["hits"]:
doc = res["hits"]["hits"][0]
youngest = datetime.datetime.fromtimestamp(doc["_source"]["epoch"])