mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-28 02:07:05 -04:00
refac
This commit is contained in:
@@ -74,6 +74,7 @@ def run_migrations():
|
||||
command.upgrade(alembic_cfg, 'head')
|
||||
except Exception as e:
|
||||
log.exception(f'Error running migrations: {e}')
|
||||
raise
|
||||
|
||||
|
||||
if ENABLE_DB_MIGRATIONS:
|
||||
|
||||
@@ -8,7 +8,6 @@ from open_webui.constants import ERROR_MESSAGES
|
||||
from open_webui.models.access_grants import AccessGrantModel, AccessGrants
|
||||
from open_webui.models.groups import Groups
|
||||
from open_webui.models.users import User, UserModel, UserResponse
|
||||
from open_webui.utils.automations import rrule_interval_seconds
|
||||
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
||||
from sqlalchemy import (
|
||||
JSON,
|
||||
@@ -198,6 +197,8 @@ class CalendarEventForm(BaseModel):
|
||||
@classmethod
|
||||
def reject_sub_daily_rrule(cls, value: Optional[str]) -> Optional[str]:
|
||||
if value:
|
||||
from open_webui.utils.automations import rrule_interval_seconds
|
||||
|
||||
try:
|
||||
interval = rrule_interval_seconds(value)
|
||||
except ValueError:
|
||||
@@ -228,6 +229,8 @@ class CalendarEventUpdateForm(BaseModel):
|
||||
@classmethod
|
||||
def reject_sub_daily_rrule(cls, value: Optional[str]) -> Optional[str]:
|
||||
if value:
|
||||
from open_webui.utils.automations import rrule_interval_seconds
|
||||
|
||||
try:
|
||||
interval = rrule_interval_seconds(value)
|
||||
except ValueError:
|
||||
|
||||
Reference in New Issue
Block a user