Show policy, grading policy, and top-level errors

* Save errors for courses that failed to load in modulestore
* global staff can see course errors on their dashboard
* put policy loading errors into the error trackers
* add has_access(user, 'global', 'staff'), which is equiv to user.is_staff for now
This commit is contained in:
Victor Shnayder
2012-08-21 11:09:58 -04:00
parent f866854411
commit b97a2af2a2
7 changed files with 104 additions and 18 deletions

View File

@@ -140,7 +140,19 @@ def dashboard(request):
if not user.is_active:
message = render_to_string('registration/activate_account_notice.html', {'email': user.email})
context = {'courses': courses, 'message': message}
# Global staff can see what courses errored on their dashboard
staff_access = False
if has_access(user, 'global', 'staff'):
# Show any courses that errored on load
staff_access = True
errored_courses = modulestore().get_errored_courses()
context = {'courses': courses,
'message': message,
'staff_access': staff_access,
'errored_courses': errored_courses,}
return render_to_response('dashboard.html', context)