Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SubscribedTasksPage(GCIRequestHandler):
- """View for the list of the tasks the specified profile is subscribed to."""
- def templatePath(self):
- return 'v2/modules/gci/leaderboard/student_tasks.html'
- def djangoURLPatterns(self):
- return [
- url(r'subscribed_tasks/%s$' % url_patterns.PROFILE, self,
- name=url_names.GCI_SUBSCRIBED_TASKS),
- ]
- def checkAccess(self, data, check, mutator):
- mutator.profileFromKwargs()
- check.hasProfile()
- if data.profile.key() != data.url_profile.key():
- raise AccessViolation('You do not have access to this data')
- def jsonContext(self, data, check, mutator):
- return SubscribedTasksList(data).getListData().content()
- def context(self, data, check, mutator):
- return {
- 'page_name': "Tasks %s is subscribed to" % data.url_profile.name(),
- 'tasks_list': SubscribedTasksList(data),
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement