Commit af9c9469 authored by John Red Medrano's avatar John Red Medrano

bug fixed on dashboard

parent 4ce8c939
......@@ -31,12 +31,20 @@ class RMSDashBoardViewSet(APIView):
arr_company = []
recently_company = {}
recently_users = User.objects.all().values(
'name',
'department__company__name',
'department__name',
'date_joined'
).order_by('-date_joined')[0:9]
)
# recently_users = User.objects.all().values(
# 'name',
# 'department__company__name',
# 'department__name',
# 'date_joined'
# ).order_by('-date_joined')[0:10]
if user_type == enums_department:
......@@ -57,6 +65,10 @@ class RMSDashBoardViewSet(APIView):
recently_company['date_added'] = request.user.department.company.created
arr_company.append(recently_company)
recently_users = recently_users.filter(
department=str(user_department)
)
elif user_type == enums_company:
company_count = 1
......@@ -79,6 +91,10 @@ class RMSDashBoardViewSet(APIView):
arr_company.append(recently_company)
recently_users = recently_users.filter(
department__company__code=str(user_company)
)
else:
company_count = Company.objects.all().count()
companies = Company.objects.all()[0:10]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment