Skip to content

Commit

Permalink
Merge branch 'main' into hy/type_hints_all
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Dec 23, 2024
2 parents 07dcf80 + 39df994 commit 986f71b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ def create_tenant(email: str, language: Optional[str] = None, name: Optional[str
if language not in languages:
language = "en-US"

if name is not None:
name = name.strip()
# Validates name encoding for non-Latin characters.
name = name.strip().encode("utf-8").decode("utf-8") if name else None

# generate random password
new_password = secrets.token_urlsafe(16)
Expand Down
7 changes: 5 additions & 2 deletions api/models/workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from collections.abc import Mapping, Sequence
from datetime import datetime
from datetime import UTC, datetime
from enum import Enum, StrEnum
from typing import TYPE_CHECKING, Any, Optional, Union

Expand Down Expand Up @@ -109,7 +109,10 @@ class Workflow(db.Model): # type: ignore[name-defined]
created_at: Mapped[datetime] = mapped_column(db.DateTime, nullable=False, server_default=func.current_timestamp())
updated_by: Mapped[Optional[str]] = mapped_column(StringUUID)
updated_at: Mapped[datetime] = mapped_column(
db.DateTime, nullable=False, server_default=func.current_timestamp(), server_onupdate=func.current_timestamp()
db.DateTime,
nullable=False,
default=datetime.now(UTC).replace(tzinfo=None),
server_onupdate=func.current_timestamp(),
)
_environment_variables: Mapped[str] = mapped_column(
"environment_variables", db.Text, nullable=False, server_default="{}"
Expand Down

0 comments on commit 986f71b

Please sign in to comment.