mirror of
https://github.com/frappe/lms.git
synced 2026-04-28 03:29:26 +03:00
fix: resolve ruff-format and prettier linting errors
This commit is contained in:
@@ -130,7 +130,6 @@
|
||||
v-model="showAttendance"
|
||||
:live_class="attendanceFor"
|
||||
/>
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import { createListResource, Button, Tooltip } from 'frappe-ui'
|
||||
@@ -191,7 +190,11 @@ const openLiveClassModal = () => {
|
||||
const hasProviderAccount = () => {
|
||||
const data = props.batch.data
|
||||
if (data?.conferencing_provider === 'Zoom' && data?.zoom_account) return true
|
||||
if (data?.conferencing_provider === 'Google Meet' && data?.google_meet_account) return true
|
||||
if (
|
||||
data?.conferencing_provider === 'Google Meet' &&
|
||||
data?.google_meet_account
|
||||
)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -137,10 +137,16 @@ class LMSBatch(Document):
|
||||
|
||||
google_meet_settings = frappe.get_doc("LMS Google Meet Settings", self.google_meet_account)
|
||||
if not google_meet_settings.enabled:
|
||||
frappe.throw(_("The selected Google Meet account is disabled. Please enable it or select another account."))
|
||||
frappe.throw(
|
||||
_(
|
||||
"The selected Google Meet account is disabled. Please enable it or select another account."
|
||||
)
|
||||
)
|
||||
|
||||
if not google_meet_settings.google_calendar:
|
||||
frappe.throw(_("The selected Google Meet account does not have a Google Calendar configured."))
|
||||
frappe.throw(
|
||||
_("The selected Google Meet account does not have a Google Calendar configured.")
|
||||
)
|
||||
|
||||
elif self.conferencing_provider == "Zoom":
|
||||
if not self.zoom_account:
|
||||
@@ -298,7 +304,11 @@ def create_google_meet_live_class(
|
||||
frappe.throw(_("Please enable the Google Meet account to use this feature."))
|
||||
|
||||
if not google_meet_settings.google_calendar:
|
||||
frappe.throw(_("The Google Meet account does not have a Google Calendar configured. Please set up a Google Calendar first."))
|
||||
frappe.throw(
|
||||
_(
|
||||
"The Google Meet account does not have a Google Calendar configured. Please set up a Google Calendar first."
|
||||
)
|
||||
)
|
||||
|
||||
class_details = frappe.get_doc(
|
||||
{
|
||||
|
||||
@@ -23,8 +23,12 @@ class LMSLiveClass(Document):
|
||||
if not self.event:
|
||||
return
|
||||
|
||||
if not self.has_value_changed("date") and not self.has_value_changed("time") \
|
||||
and not self.has_value_changed("duration") and not self.has_value_changed("title"):
|
||||
if (
|
||||
not self.has_value_changed("date")
|
||||
and not self.has_value_changed("time")
|
||||
and not self.has_value_changed("duration")
|
||||
and not self.has_value_changed("title")
|
||||
):
|
||||
return
|
||||
|
||||
self._update_linked_event()
|
||||
@@ -96,7 +100,9 @@ class LMSLiveClass(Document):
|
||||
|
||||
if not meet_link:
|
||||
frappe.msgprint(
|
||||
_("The Meet link is not yet available. It will be generated once Google Calendar syncs the event. Please refresh the page after a few moments."),
|
||||
_(
|
||||
"The Meet link is not yet available. It will be generated once Google Calendar syncs the event. Please refresh the page after a few moments."
|
||||
),
|
||||
indicator="orange",
|
||||
alert=True,
|
||||
)
|
||||
@@ -139,7 +145,9 @@ class LMSLiveClass(Document):
|
||||
except Exception:
|
||||
frappe.log_error(title=_("Google Meet - Failed to add participants to calendar event"))
|
||||
frappe.msgprint(
|
||||
_("Live class was created but calendar invites could not be sent to participants. You may need to share the Meet link manually."),
|
||||
_(
|
||||
"Live class was created but calendar invites could not be sent to participants. You may need to share the Meet link manually."
|
||||
),
|
||||
indicator="orange",
|
||||
alert=True,
|
||||
)
|
||||
|
||||
@@ -252,9 +252,7 @@ class TestLMSLiveClass(BaseTestUtils):
|
||||
(t, n) for t, n in self.cleanup_items if not (t == "LMS Live Class" and n == live_class.name)
|
||||
]
|
||||
# Remove event from cleanup too since on_trash will delete it
|
||||
self.cleanup_items = [
|
||||
(t, n) for t, n in self.cleanup_items if not (t == "Event" and n == event.name)
|
||||
]
|
||||
self.cleanup_items = [(t, n) for t, n in self.cleanup_items if not (t == "Event" and n == event.name)]
|
||||
frappe.delete_doc("LMS Live Class", live_class.name, force=True)
|
||||
|
||||
self.assertFalse(frappe.db.exists("Event", event.name))
|
||||
|
||||
Reference in New Issue
Block a user