Fix poll processing for Pleroma

This commit is contained in:
Thomas Sileo 2019-07-07 13:42:39 +02:00
parent 37d9add7f4
commit 6c12eed0fc

View file

@ -479,7 +479,7 @@ class MicroblogPubBackend(Backend):
question = create.get_object() question = create.get_object()
if question.has_type(ap.ActivityType.QUESTION): if question.has_type(ap.ActivityType.QUESTION):
now = datetime.now(timezone.utc) now = datetime.now(timezone.utc)
dt = parser.parse(question.closed or question.endTime) dt = parser.parse(question.closed or question.endTime).astimezone(timezone.utc)
minutes = int((dt - now).total_seconds() / 60) minutes = int((dt - now).total_seconds() / 60)
Tasks.fetch_remote_question(create.id, minutes) Tasks.fetch_remote_question(create.id, minutes)