fix: removed unused form add messages, changed url for new batch form in course.html, changed get_recent_sketch to have an owner filter

This commit is contained in:
pateljannat
2021-05-03 15:57:00 +05:30
parent cf68d3127c
commit 2139bddf01
6 changed files with 4 additions and 100 deletions

View File

@@ -111,11 +111,11 @@
{% endfor %}
</div>
<a class="btn btn-primary add-batch margin-bottom" href="/add-a-new-batch?new=1&course={{course.name}}">Add a new batch</a>
<a class="btn btn-primary add-batch margin-bottom" href="/add-a-new-batch?new=1&course={{course.title}}">Add a new batch</a>
{% else %}
<div class="mentor_message">
<p> You are a mentor for this course. </p>
<a class="btn btn-primary" href="/add-a-new-batch?new=1&course={{course.name}}" >Create your first batch</a>
<a class="btn btn-primary" href="/add-a-new-batch?new=1&course={{course.title}}" >Create your first batch</a>
</div>
{% endif %}
{% endmacro %}

View File

@@ -1,5 +1,5 @@
import frappe
from ...lms.doctype.lms_sketch.lms_sketch import get_recent_sketches
from community.lms.models import Sketch
def get_context(context):
context.no_cache = 1
@@ -8,7 +8,7 @@ def get_context(context):
if not context.member:
context.template = "www/404.html"
else:
context.sketches = list(filter(lambda x: x.owner == context.member.email, get_recent_sketches()))
context.sketches = Sketch.get_recent_sketches(context.member.email)
def get_member(username):
try: