Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ux): is_agent: change syntax #1303

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions desk/src/pages/desk/AgentRoot.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="flex h-screen w-screen">
<SideBar />
<router-view class="z-0 grow overflow-auto" />
</div>
<div class="flex h-screen w-screen">
<SideBar />
<router-view class="z-0 grow overflow-auto" />
</div>
</template>

<script setup lang="ts">
Expand All @@ -18,12 +18,12 @@ const authStore = useAuthStore();
const configStore = useConfigStore();

onBeforeMount(() => {
if (!authStore.hasDeskAccess) {
router.replace({ name: CUSTOMER_PORTAL_LANDING });
}
if (!authStore.hasDeskAccess) {
router.replace({ name: CUSTOMER_PORTAL_LANDING });
}

if (!configStore.isSetupComplete) {
router.replace({ name: ONBOARDING_PAGE });
}
if (!configStore.isSetupComplete) {
router.replace({ name: ONBOARDING_PAGE });
}
});
</script>
2 changes: 1 addition & 1 deletion helpdesk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def is_agent(user: str = frappe.session.user) -> bool:
:param user: User to check against, defaults to current user
:return: Whether `user` is an agent
"""
return bool(frappe.db.exists("HD Agent", user))
return bool(frappe.db.exists("HD Agent", {"name": user}))


def publish_event(event: str, data: dict):
Expand Down
Loading