[PR #18771] optimize account status field hard coded #28993

Closed
opened 2026-02-21 20:44:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/18771

State: closed
Merged: Yes


Just optimize the hard-coded operation of the account.status field:

def account_initialization_required(view):
    @wraps(view)
    def decorated(*args, **kwargs):
        # check account initialization
        account = current_user

        if account.status == "uninitialized": #  here changed to AccountStatus.UNINITIALIZED
            raise AccountNotInitializedError()

        return view(*args, **kwargs)

    return decorated

**Original Pull Request:** https://github.com/langgenius/dify/pull/18771 **State:** closed **Merged:** Yes --- Just optimize the hard-coded operation of the` account.status` field: ``` def account_initialization_required(view): @wraps(view) def decorated(*args, **kwargs): # check account initialization account = current_user if account.status == "uninitialized": # here changed to AccountStatus.UNINITIALIZED raise AccountNotInitializedError() return view(*args, **kwargs) return decorated ```
yindo added the pull-request label 2026-02-21 20:44:39 -05:00
yindo closed this issue 2026-02-21 20:44:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#28993