Skip to content

Commit

Permalink
Load request page with data
Browse files Browse the repository at this point in the history
Currently the /request page loads with no data which can be confusuing
to new users. This allows the page to always load with data and can be
modified as was earlier using the form
  • Loading branch information
Projjol committed Aug 17, 2018
1 parent 12ff958 commit f709fc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mainapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http import JsonResponse
from django.http import HttpResponseRedirect
from django.http import QueryDict
from django import forms
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
Expand Down Expand Up @@ -124,7 +125,10 @@ def __init__(self, *args, **kwargs):


def request_list(request):
filter = RequestFilter(request.GET, queryset=Request.objects.all() )
if bool(request.GET) == False:
filter = RequestFilter(QueryDict('district=&requestee__icontains=&requestee_phone=&location__icontains='), queryset=Request.objects.all())
else:
filter = RequestFilter(request.GET, queryset=Request.objects.all() )
req_data = filter.qs.order_by('-id')
paginator = Paginator(req_data, 100)
page = request.GET.get('page')
Expand Down

0 comments on commit f709fc0

Please sign in to comment.