Skip to content

Commit 4860cf3

Browse files
authored
Merge pull request #2406 from raizasafeel/fix/certification
fix(certificate): permission and progress check
2 parents d23c98a + 5699b69 commit 4860cf3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/components/CourseCardOverlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const is_instructor = () => {
230230
const canGetCertificate = computed(() => {
231231
if (
232232
props.course.data?.enable_certification &&
233-
props.course.data?.membership?.progress == 100
233+
props.course.data?.membership?.progress >= 100
234234
) {
235235
return true
236236
}

lms/lms/doctype/lms_certificate/lms_certificate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def on_update(self):
148148

149149

150150
def has_website_permission(doc, ptype, user, verbose=False):
151-
if ptype in ["read", "print"]:
151+
if ptype in ["read", "print"] and doc.published:
152152
return True
153153
if doc.member == user and ptype == "create":
154154
return True

0 commit comments

Comments
 (0)