This includes all boards, as well as report counts if the user is an admin. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
32 lines
750 B
Python
32 lines
750 B
Python
from django.conf import settings as django_settings
|
|
from board.models import Board, ReportRecord
|
|
|
|
|
|
def settings(request):
|
|
return {"settings": django_settings}
|
|
|
|
|
|
def boards(request):
|
|
return {"boards": Board.objects.filter(readonly=False)}
|
|
|
|
|
|
def reports(request):
|
|
user = request.user
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
print("reports!")
|
|
if user and user.has_perm("board.view_reportrecord"):
|
|
return {
|
|
"reports": ReportRecord.objects.all(),
|
|
"reports_urgent": ReportRecord.objects.filter(urgent=True),
|
|
}
|
|
else:
|
|
return {}
|