mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
feat:支持订阅绑定类别和自定义识别词
This commit is contained in:
+1
-13
@@ -1,7 +1,6 @@
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, validator
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
# Shared properties
|
||||
@@ -23,17 +22,6 @@ class UserBase(BaseModel):
|
||||
# 个性化设置
|
||||
settings: Optional[dict] = {}
|
||||
|
||||
@validator('permissions', 'settings', pre=True)
|
||||
def parse_json_fields(cls, value):
|
||||
if value:
|
||||
if isinstance(value, str):
|
||||
try:
|
||||
return json.loads(value)
|
||||
except json.JSONDecodeError:
|
||||
return {}
|
||||
return value
|
||||
return {}
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user