mirror of
https://github.com/frappe/lms.git
synced 2026-04-23 08:47:59 +03:00
Merge pull request #2311 from raizasafeel/fix
fix: loading state on batch details, student enrollment by admin
This commit is contained in:
@@ -3,10 +3,17 @@
|
||||
v-model="show"
|
||||
:options="{
|
||||
size: 'xl',
|
||||
title: studentDetails.data?.full_name || __('Student Details'),
|
||||
}"
|
||||
>
|
||||
<template #body>
|
||||
<div v-if="studentDetails.data" class="p-5 space-y-10 text-sm">
|
||||
<div
|
||||
v-if="studentDetails.loading && !studentDetails.data"
|
||||
class="flex items-center justify-center py-12"
|
||||
>
|
||||
<LoadingIndicator class="size-4" />
|
||||
</div>
|
||||
<div v-else-if="studentDetails.data" class="p-5 space-y-10 text-sm">
|
||||
<div class="flex items-center gap-x-2">
|
||||
<Avatar :image="studentDetails.data.user_image" size="3xl" />
|
||||
<div class="space-y-1">
|
||||
@@ -136,6 +143,7 @@ import {
|
||||
ListRows,
|
||||
ListRow,
|
||||
ListRowItem,
|
||||
LoadingIndicator,
|
||||
} from 'frappe-ui'
|
||||
import { useRouter } from 'vue-router'
|
||||
import ProgressBar from '@/components/ProgressBar.vue'
|
||||
|
||||
@@ -32,7 +32,7 @@ class LMSBatchEnrollment(Document):
|
||||
|
||||
def validate_payment(self):
|
||||
paid_batch = frappe.db.get_value("LMS Batch", self.batch, "paid_batch")
|
||||
if paid_batch:
|
||||
if paid_batch and not self.is_admin():
|
||||
payment = frappe.db.exists(
|
||||
"LMS Payment",
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ class LMSEnrollment(Document):
|
||||
if not course_details.published and not is_admin():
|
||||
frappe.throw(_("You cannot enroll in an unpublished course."))
|
||||
|
||||
if course_details.paid_course:
|
||||
if course_details.paid_course and not is_admin():
|
||||
payment = frappe.db.exists(
|
||||
"LMS Payment",
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user