Skip to content

Commit

Permalink
Merge pull request #12 from lapig-ufg/email
Browse files Browse the repository at this point in the history
tz=datetime.timezone.utc
  • Loading branch information
jairomr authored Oct 3, 2024
2 parents 8c2f7ff + 7fb3b36 commit 65a5ee4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List
from app.models.oauth2 import UserInfo
from pydantic_geojson import FeatureModel, FeatureCollectionModel, PolygonModel
from datetime import datetime
from datetime import datetime, timezone

class User(BaseModel):
name: str
Expand All @@ -20,7 +20,7 @@ class LapigFeatureCollectionModel(FeatureCollectionModel):

class ResultPayload(BaseModel):
user: User
created_at: datetime = datetime.now(tz=datetime.timezone.utc)
created_at: datetime = datetime.now(tz=timezone.utc)
geojson: LapigFeatureCollectionModel
request_user: UserInfo
class PayloadSaveGeojson(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions workers/gee.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from workers.utils.gee2chat import get_chat_pasture, get_chat_pasture_vigor
from app.models.payload import ResultPayload
from celery.utils.log import get_task_logger
from datetime import datetime
from datetime import datetime, timezone
from pymongo import MongoClient
import ee
import geemap
Expand All @@ -11,7 +11,7 @@
logger = get_task_logger(__name__)

def task_index_pasture(task_id: str, payload: ResultPayload):
payload['created_at'] = datetime.now(tz=datetime.timezone.utc)
payload['created_at'] = datetime.now(tz=timezone.utc)
geojson = payload.get('geojson')
def gee_credentials(private_key_file):
data = json.load(open(private_key_file))
Expand Down

0 comments on commit 65a5ee4

Please sign in to comment.