refactor: 后端代码清理-移除死代码和无用文件
Deploy / Deploy Staging (push) Failing after 138h54m45s
CI/CD Pipeline / Frontend Lint (push) Failing after 138h55m17s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 138h55m24s
Deploy / Staging E2E Tests (push) Failing after 1797h20m44s
Deploy / Deploy Production (push) Failing after 1797h27m17s
Deploy / Build Production Runtime Images (push) Failing after 1797h27m19s
Deploy / Production Browser E2E (push) Failing after 1797h58m41s
Deploy / Deploy Staging (push) Failing after 138h54m45s
CI/CD Pipeline / Frontend Lint (push) Failing after 138h55m17s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 138h55m24s
Deploy / Staging E2E Tests (push) Failing after 1797h20m44s
Deploy / Deploy Production (push) Failing after 1797h27m17s
Deploy / Build Production Runtime Images (push) Failing after 1797h27m19s
Deploy / Production Browser E2E (push) Failing after 1797h58m41s
- 删除 packages/domain/permissions.py(完全未引用的权限模块) - 删除 packages/adapters/sqlite_tracker/(空包,无实现文件) - 移除 requirements.txt 中未使用的依赖:aiosmtplib、python-dotenv - 清理 test_email_service.py 中 workspace 邀请邮件的废弃测试
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
"""SQLite Tracker Adapter"""
|
||||
|
||||
__all__ = [
|
||||
"SQLiteTaskRepository",
|
||||
"SQLiteMilestoneRepository",
|
||||
"SQLiteTaskIssueRepository",
|
||||
]
|
||||
@@ -1,50 +0,0 @@
|
||||
"""
|
||||
Permissions module.
|
||||
All permission checks pass by default (workspace concept removed).
|
||||
"""
|
||||
|
||||
|
||||
class PermissionChecker:
|
||||
"""Permission checker - all checks pass by default."""
|
||||
|
||||
def __init__(self, member_repository=None):
|
||||
self.member_repository = member_repository
|
||||
|
||||
def check_access(self, project_id, user_id):
|
||||
return True, "owner"
|
||||
|
||||
def check_is_owner(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
def check_is_admin_or_owner(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
def check_can_manage_members(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
def check_can_edit_project(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
def check_can_delete_project(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
def check_can_view_project(self, project_id, user_id):
|
||||
return True
|
||||
|
||||
|
||||
class Permission:
|
||||
PROJECT_VIEW = "project:view"
|
||||
PROJECT_CREATE = "project:create"
|
||||
PROJECT_EDIT = "project:edit"
|
||||
PROJECT_DELETE = "project:delete"
|
||||
ASSET_VIEW = "asset:view"
|
||||
ASSET_UPLOAD = "asset:upload"
|
||||
ASSET_EDIT = "asset:edit"
|
||||
ASSET_DELETE = "asset:delete"
|
||||
|
||||
|
||||
ROLE_PERMISSIONS = {}
|
||||
|
||||
|
||||
def has_permission(role, permission):
|
||||
return True
|
||||
@@ -21,9 +21,6 @@ python-multipart==0.0.32
|
||||
# Redis
|
||||
redis==5.2.0
|
||||
|
||||
# 邮件
|
||||
aiosmtplib==3.0.2
|
||||
|
||||
# HTTP 客户端
|
||||
httpx==0.27.2
|
||||
|
||||
@@ -32,9 +29,6 @@ pytest==8.3.3
|
||||
pytest-asyncio==0.24.0
|
||||
pytest-cov==6.0.0
|
||||
|
||||
# 工具
|
||||
python-dotenv==1.0.1
|
||||
|
||||
# 视频处理
|
||||
ffmpeg-python==0.2.0
|
||||
Pillow==10.4.0
|
||||
|
||||
@@ -137,30 +137,6 @@ class TestEmailService:
|
||||
# 验证收件人
|
||||
assert call_args[0][1] == ["user@example.com"]
|
||||
|
||||
@patch("smtplib.SMTP")
|
||||
def test_send_workspace_invitation_email(self, mock_smtp, email_service):
|
||||
"""测试发送工作空间邀请邮件"""
|
||||
mock_server = MagicMock()
|
||||
mock_smtp.return_value.__enter__.return_value = mock_server
|
||||
|
||||
success, error = email_service.send_workspace_invitation_email(
|
||||
to_email="user@example.com",
|
||||
inviter_name="Alice",
|
||||
workspace_name="My Workspace",
|
||||
role="admin",
|
||||
invitation_url="https://example.com/invite?token=inv123",
|
||||
)
|
||||
|
||||
assert success is True
|
||||
assert error is None
|
||||
|
||||
# 验证发送了邮件
|
||||
mock_server.sendmail.assert_called_once()
|
||||
call_args = mock_server.sendmail.call_args
|
||||
|
||||
# 验证收件人
|
||||
assert call_args[0][1] == ["user@example.com"]
|
||||
|
||||
@patch("smtplib.SMTP")
|
||||
def test_email_without_tls(self, mock_smtp):
|
||||
"""测试不使用 TLS 发送邮件"""
|
||||
|
||||
Reference in New Issue
Block a user