mirror of
https://github.com/frappe/lms.git
synced 2026-04-19 22:52:29 +03:00
Merge pull request #2230 from frappe/mergify/bp/main-hotfix/pr-2229
fix: misc issues (backport #2229)
This commit is contained in:
@@ -29,14 +29,12 @@
|
||||
:label="__('Date')"
|
||||
:required="true"
|
||||
/>
|
||||
<Tooltip :text="__('Duration of the live class in minutes')">
|
||||
<FormControl
|
||||
type="number"
|
||||
v-model="liveClass.duration"
|
||||
:label="__('Duration')"
|
||||
:required="true"
|
||||
/>
|
||||
</Tooltip>
|
||||
<FormControl
|
||||
type="number"
|
||||
v-model="liveClass.duration"
|
||||
:label="__('Duration (in minutes)')"
|
||||
:required="true"
|
||||
/>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<Tooltip
|
||||
@@ -186,6 +184,7 @@ const submitLiveClass = (close) => {
|
||||
},
|
||||
onError(err) {
|
||||
toast.error(err.messages?.[0] || err)
|
||||
console.error(err)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -64,13 +64,13 @@
|
||||
</template>
|
||||
</Dropdown>
|
||||
</div>
|
||||
<div class="flex items-center mb-3">
|
||||
<div class="flex items-center mb-2">
|
||||
<Calendar class="w-4 h-4 stroke-1.5" />
|
||||
<span class="ml-2">
|
||||
{{ dayjs(evl.date).format('DD MMMM YYYY') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center mb-3">
|
||||
<div class="flex items-center mb-2">
|
||||
<Clock class="w-4 h-4 stroke-1.5" />
|
||||
<span class="ml-2">
|
||||
{{ formatTime(evl.start_time) }}
|
||||
|
||||
@@ -419,9 +419,16 @@ watch(
|
||||
() => batchDetail.doc,
|
||||
() => {
|
||||
if (!batchDetail.doc) return
|
||||
getMetaInfo('batches', batchDetail.doc?.name, meta)
|
||||
|
||||
if (originalDoc.value) {
|
||||
isDirty.value =
|
||||
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
|
||||
}
|
||||
|
||||
updateBatchData()
|
||||
}
|
||||
getMetaInfo('batches', batchDetail.doc?.name, meta)
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const updateBatchData = () => {
|
||||
@@ -499,17 +506,6 @@ const updateBatch = () => {
|
||||
)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => batchDetail.doc,
|
||||
() => {
|
||||
if (originalDoc.value) {
|
||||
isDirty.value =
|
||||
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const deleteBatch = () => {
|
||||
$dialog({
|
||||
title: __('Confirm your action to delete'),
|
||||
|
||||
@@ -180,10 +180,12 @@ const onInstructorCreated = (user: any) => {
|
||||
|
||||
const validateFields = () => {
|
||||
batch.value.description = sanitizeHTML(batch.value.description)
|
||||
batch.value.batch_details = sanitizeHTML(batch.value.batch_details)
|
||||
|
||||
Object.keys(batch.value).forEach((key) => {
|
||||
if (
|
||||
key != 'description' &&
|
||||
key != 'batch_details' &&
|
||||
typeof batch.value[key as keyof Batch] === 'string'
|
||||
) {
|
||||
batch.value[key as keyof Batch] = escapeHTML(
|
||||
|
||||
@@ -149,6 +149,7 @@ import {
|
||||
createResource,
|
||||
TabButtons,
|
||||
Tooltip,
|
||||
toast,
|
||||
usePageMeta,
|
||||
} from 'frappe-ui'
|
||||
import { computed, inject, watch, ref, onMounted, watchEffect } from 'vue'
|
||||
@@ -279,11 +280,17 @@ const getTabButtons = () => {
|
||||
}
|
||||
|
||||
const reloadUser = () => {
|
||||
call('frappe.sessions.clear').then(() => {
|
||||
$user.reload().then(() => {
|
||||
profile.reload()
|
||||
call('frappe.sessions.clear')
|
||||
.then(() => {
|
||||
$user.reload().then(() => {
|
||||
profile.reload()
|
||||
toast.success(__('Session refreshed successfully'))
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error(__('Failed to refresh session'))
|
||||
console.error(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const navigateTo = (url) => {
|
||||
|
||||
@@ -7,6 +7,7 @@ def after_install():
|
||||
create_batch_source()
|
||||
give_discussions_permission()
|
||||
give_user_list_permission()
|
||||
give_event_permission()
|
||||
|
||||
|
||||
def after_sync():
|
||||
@@ -189,8 +190,22 @@ def give_user_list_permission():
|
||||
create_role(doctype, "System Manager", 1)
|
||||
|
||||
|
||||
def create_role(doctype, role, permlevel):
|
||||
def give_event_permission():
|
||||
doctype = "Event"
|
||||
roles = ["Moderator", "Batch Evaluator"]
|
||||
for role in roles:
|
||||
permlevel = 0
|
||||
create_role(doctype, role, permlevel, 1, 1)
|
||||
create_role(doctype, "System Manager", 0, 1, 1)
|
||||
|
||||
|
||||
def create_role(doctype, role, permlevel, write=0, create=0):
|
||||
if not frappe.db.exists("Custom DocPerm", {"parent": doctype, "role": role, "permlevel": permlevel}):
|
||||
if not write and not create:
|
||||
if role in ["Moderator", "System Manager"]:
|
||||
write = 1
|
||||
if role == "Moderator":
|
||||
create = 1
|
||||
doc = frappe.new_doc("Custom DocPerm")
|
||||
doc.update(
|
||||
{
|
||||
@@ -198,8 +213,9 @@ def create_role(doctype, role, permlevel):
|
||||
"parent": doctype,
|
||||
"role": role,
|
||||
"read": 1,
|
||||
"write": 1 if role in ["Moderator", "System Manager"] else 0,
|
||||
"create": 1 if role == "Moderator" else 0,
|
||||
"select": 1,
|
||||
"write": write,
|
||||
"create": create,
|
||||
"permlevel": permlevel,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
"label": "Contact Us URL"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"default": "1",
|
||||
"fieldname": "certifications",
|
||||
"fieldtype": "Check",
|
||||
"label": "Certifications"
|
||||
@@ -512,7 +512,7 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2026-03-10 18:18:51.733955",
|
||||
"modified": "2026-03-18 15:32:56.259783",
|
||||
"modified_by": "sayali@frappe.io",
|
||||
"module": "LMS",
|
||||
"name": "LMS Settings",
|
||||
|
||||
@@ -121,4 +121,5 @@ lms.patches.v2_0.give_user_list_permission #11-02-2026
|
||||
lms.patches.v2_0.rename_badge_assignment_event
|
||||
lms.patches.v2_0.enable_allow_job_posting
|
||||
lms.patches.v2_0.set_conferencing_provider_for_zoom
|
||||
lms.patches.v2_0.sync_evaluator_roles
|
||||
lms.patches.v2_0.sync_evaluator_roles
|
||||
lms.patches.v2_0.give_event_permission #10-03-2026
|
||||
5
lms/patches/v2_0/give_event_permission.py
Normal file
5
lms/patches/v2_0/give_event_permission.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from lms.install import give_event_permission
|
||||
|
||||
|
||||
def execute():
|
||||
give_event_permission()
|
||||
Reference in New Issue
Block a user