@sarina You commented on this section earlier suggesting this:

```
if course_slug is None:
    return False

if (course_slug.endswith('_') and course_wiki_slug_is_numerical(course_slug[:-1]):
    course_slug = course_slug[:-1]

if user_is_staff_on_course_number(user, course_slug):
    return True
return False
```

Consider the course with course number 202_. Its instructor group will be named something like "instructor_mitx/202_/fall" and its course slug will be "202_". Since this ends with an underscore and 202 is a number course_slug will be set to "202" and so the above simplification will not work. Hence the need for the two checks.

However I have refactored this a bit so that there is only one db access.