Exemple #1
0
 def file_a_report(self, event_key):
     report_key =  Report.is_report_exist(event_key)
     if report_key:
         return report_key
         
     else :
         return Report.create_report(self.user.key, event_key)
Exemple #2
0
 def get_template_context(self):
     context = {}
     reports = Report.get_all()
     reports_and_events = []
     for a_report in reports:
         report = dict(a_report.get_report_in_dict())
         
         reporter = self._get_user_by_key(report['reported_by'])
         if reporter.type == 'student':
             report['reporter'] = " ".join((reporter.firstname, reporter.name))
         else:
             report['reporter'] = reporter.name
         report['reporter_id'] = reporter.key.id()
         report['reporter_type'] = reporter.type
         report['event'] = self.get_event_with_context(a_report.event.get().get_event_in_dict())
         
         reports_and_events.append(report)
     context['reports'] = reports_and_events
     context['left_sidebar'] = 'reports'
     return context