Skip to content

Commit

Permalink
refactor: added per view cache for pending review products✨
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainchisty committed Nov 10, 2021
1 parent fbc2f2b commit 267ac81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions review/views.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
from customers.decorators import customer_required
from django.contrib import messages
from django.shortcuts import redirect, render
from django.views.decorators.cache import cache_page
from order.models import OrderItem
from review.models import Review

from .forms import ReviewForm


@cache_page(60 * 60)
@customer_required
def customerReviewHistory(request):
''' customer purchased product review history.'''
reviews = Review.objects.filter(customer=request.user.customer, product__is_review=True)
return render(request, 'review/review.html', {'reviews': reviews})


@cache_page(60 * 60)
@customer_required
def toBeReviewed(request):
''' customer who hasn't Reviewed product.'''
Expand Down

0 comments on commit 267ac81

Please sign in to comment.