refactor(api): fix pyright check

- Replaced `is_editor` checks with `has_edit_permission` in `workflow_trigger.py` and `workflow.py` to enhance clarity and consistency in permission handling.
- Updated the rate limiter to use `datetime.now(UTC)` instead of `datetime.utcnow()` for accurate time handling.
- Added `__all__` declaration in `trigger/__init__.py` for better module export management.
- Initialized `debug_dispatched` variable in `trigger_processing_tasks.py` to ensure proper tracking during workflow dispatching.

These changes improve code readability and maintainability while ensuring correct permission checks and time management.
This commit is contained in:
Harry
2025-09-25 18:32:22 +08:00
parent aef862d9ce
commit 452588dded
5 changed files with 11 additions and 5 deletions

View File

@ -110,7 +110,7 @@ class AppTriggerEnableApi(Resource):
assert isinstance(current_user, Account)
assert current_user.current_tenant_id is not None
if not current_user.is_editor:
if not current_user.has_edit_permission:
raise Forbidden()
trigger_id = args["trigger_id"]