refactor: simplified the condition to check is user is instructor
This commit is contained in:
@@ -421,16 +421,11 @@ def get_initial_members(course):
|
|||||||
|
|
||||||
|
|
||||||
def is_instructor(course):
|
def is_instructor(course):
|
||||||
return (
|
instructors = get_instructors("LMS Course", course)
|
||||||
len(
|
for instructor in instructors:
|
||||||
list(
|
if instructor.name == frappe.session.user:
|
||||||
filter(
|
return True
|
||||||
lambda x: x.name == frappe.session.user, get_instructors("LMS Course", course)
|
return False
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
> 0
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def convert_number_to_character(number):
|
def convert_number_to_character(number):
|
||||||
|
|||||||
Reference in New Issue
Block a user