diff --git a/lms/urls.py b/lms/urls.py index 2424496..8d6616d 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -9,7 +9,6 @@ from access.views import profile_view urlpatterns = [ url(r'^$', views.index), - url(r'^price/$', views.price), url(r'^oferta/', views.show_oferta), url(r'^test/$', views.test), url(r'^all_comments/$', views.all_comments), diff --git a/lms/views.py b/lms/views.py index b38c0b4..e403538 100644 --- a/lms/views.py +++ b/lms/views.py @@ -31,48 +31,6 @@ def access_error(request): return {} -@response_decor(template='price.html', without_auth=True) -def price(request): - if request.user.is_authenticated() and request.user.in_role in ['M', 'S']: - return {'redirect': '/access/profile'} - journals = [] - for course in Course.objects.all() if request.user.is_authenticated() and request.user.is_admin else Course.objects.filter(public=True): - do = True - if course.hidden: - if not request.user.is_authenticated(): - do = False - else: - if not request.user.is_admin: - try: - Bill.objects.get(service__course=course, user=request.user, status='F') - except Bill.DoesNotExist: - do = False - if do: - journal, created = TeacherJ.objects.get_or_create(course=course, student=user_fabric(request.user)) - if not journal.full and Bill.objects.filter(user=user_fabric(request.user), service__course=course, status='F').exists(): - if not journal.start_date: - journal.start_date = datetime.datetime.now() - journal.save() - check_journal(journal) - journals.append(journal.get_head_face()) - - with open(STATIC_ROOT+'/prices.csv', mode='r') as infile: - reader = csv.reader(infile) - prices = {} - - for rows in reader: - prices[int(rows[0])] = rows[1] - - @register.filter - def get_item(dictionary, key): - return dictionary.get(key) - - return {'courses': journals, - 'prices': prices, - 'directions': ({'count': i.count(), 'title': i.title, 'color': i.color} for i in MaterialDirection.objects.all() if i.count() != 0), - 'bought': Bill.objects.filter(user=request.user, status='F').exists() if request.user.is_authenticated() else False} - - @response_decor(template='index.html', without_auth=True) def index(request): if request.user.is_authenticated() and request.user.in_role in ['M', 'S']: diff --git a/templates/index_menu.html b/templates/index_menu.html index 59d11b7..b326dfd 100755 --- a/templates/index_menu.html +++ b/templates/index_menu.html @@ -122,11 +122,6 @@ Контакты - {% if request.user.is_anonymous %} -