mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Standardised the URLs and enabled search function on applications
This commit is contained in:
14
hr/views.py
14
hr/views.py
@@ -151,8 +151,18 @@ def admin_applications(request):
|
||||
if not (request.user.is_staff or Group.objects.get(name=settings.HR_STAFF_GROUP) in request.user.groups.all()):
|
||||
return HttpResponseRedirect(reverse('hr.views.index'))
|
||||
|
||||
view_status = [APPLICATION_STATUS_AWAITINGREVIEW, APPLICATION_STATUS_ACCEPTED, APPLICATION_STATUS_QUERY]
|
||||
apps = Application.objects.filter(status__in=view_status)
|
||||
if 'q' in request.GET:
|
||||
query = request.GET['q']
|
||||
if 'l' in request.GET:
|
||||
limit = request.get['l']
|
||||
else:
|
||||
limit = 10
|
||||
print query, limit
|
||||
apps = Application.objects.filter(character__name__icontains=query)[:limit]
|
||||
else:
|
||||
view_status = [APPLICATION_STATUS_AWAITINGREVIEW, APPLICATION_STATUS_ACCEPTED, APPLICATION_STATUS_QUERY]
|
||||
apps = Application.objects.filter(status__in=view_status)
|
||||
|
||||
return render_to_response('hr/applications/admin/view_list.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user