The following if/elif conditions could be also written that way:
```
    if mentor or rep:
        user = get_object_or_404(
            User, userprofile__display_name__iexact=mentor or rep)

        if mentor:
            report_list = report_list.filter(mentor=user)
            pageheader += ' mentored by %s' % user.get_full_name()
        elif rep:
            report_list = report_list.filter(user=user)
            pageheader = 'Activities for %s' % user.get_full_name()
```