You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error you're encountering, "AttributeError: 'Account' object has no attribute 'is_editing_role'", is likely due to the absence of the is_editing_role method or attribute in the TenantAccountRole class. The Account class is attempting to use this method to check the user's role, but it seems to be missing.
To resolve this issue, ensure that the TenantAccountRole class includes a method named is_editing_role. Here's a possible implementation you can add to the TenantAccountRole class:
classTenantAccountRole:
@staticmethoddefis_editing_role(role):
# Implement the logic to determine if the role is an editing rolereturnrolein ['editor', 'admin', 'owner'] # Example roles that might have editing permissions
Make sure to adjust the logic inside is_editing_role to fit the actual roles and permissions in your application [1].
Self Checks
Dify version
1.0.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
An error was encountered when enabling the performance tracking feature.
✔️ Expected Behavior
the performance tracking feature si running
❌ Actual Behavior
api-1 | 2025-03-14 23:26:14.168 ERROR [Dummy-18] [app.py:875] - Exception on /console/api/apps/f112ffda-4341-40ce-b7ed-77bb7426803e/trace [POST]
api-1 | Traceback (most recent call last):
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
api-1 | rv = self.dispatch_request()
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
api-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 489, in wrapper
api-1 | resp = resource(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
api-1 | return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/.venv/lib/python3.12/site-packages/flask_restful/init.py", line 604, in dispatch_request
api-1 | resp = meth(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/wraps.py", line 187, in decorated
api-1 | return view(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/libs/login.py", line 94, in decorated_view
api-1 | return current_app.ensure_sync(func)(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/wraps.py", line 30, in decorated
api-1 | return view(*args, **kwargs)
api-1 | ^^^^^^^^^^^^^^^^^^^^^
api-1 | File "/app/api/controllers/console/app/app.py", line 319, in post
api-1 | if not current_user.is_editing_role:
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1 | AttributeError: 'Account' object has no attribute 'is_editing_role'
The text was updated successfully, but these errors were encountered: