access hotfix

remotes/origin/feature/effective_amount
nikita 8 years ago
parent f995da9f1c
commit 2a6cd9c58b
  1. 2
      apps/school/templates/school/livelesson_detail.html
  2. 40
      apps/school/views.py

@ -10,7 +10,7 @@
<div class="lesson__content">{{ livelesson.short_description }}</div>
<a class="lesson__video video" href="#">
{% if livelesson.stream_index %}
<iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}?playsinline=0" frameborder="0" webkitallowfullscreen
<iframe class="lesson__video_frame" src="https://player.vimeo.com/video/{{ livelesson.stream_index }}" frameborder="0" webkitallowfullscreen
mozallowfullscreen allowfullscreen>
</iframe>
<a href="#" onclick="location.reload();">Если видео не загрузилось обновите страницу</a>

@ -61,26 +61,26 @@ class LiveLessonsDetailView(DetailView):
def get(self, request, pk=None):
response = super().get(request, pk=pk)
try:
school_payment = SchoolPayment.objects.get(
user=request.user,
add_days=False,
date_start__lte=now(),
date_end__gte=now(),
status__in=[
Pingback.PINGBACK_TYPE_REGULAR,
Pingback.PINGBACK_TYPE_GOODWILL,
Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,
],
)
except SchoolPayment.DoesNotExist:
school_payment = None
if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not (
request.user.role == User.USER_ROLE and
school_payment and
school_payment.is_deliverable()
):
raise Http404
#try:
# school_payment = SchoolPayment.objects.get(
# user=request.user,
# add_days=False,
# date_start__lte=now(),
# date_end__gte=now(),
# status__in=[
# Pingback.PINGBACK_TYPE_REGULAR,
# Pingback.PINGBACK_TYPE_GOODWILL,
# Pingback.PINGBACK_TYPE_RISK_REVIEWED_ACCEPTED,
# ],
# )
#except SchoolPayment.DoesNotExist:
# school_payment = None
#if request.user.role not in [User.ADMIN_ROLE, User.TEACHER_ROLE] and not (
# request.user.role == User.USER_ROLE and
# school_payment and
# school_payment.is_deliverable()
#):
# raise Http404
return response

Loading…
Cancel
Save