Since you're using the {% else %} for the case where the list is empty, you could do like
```
{% for certinfo in certifications|byKey:course.id %}
    <a class="btn" href="{{certinfo.1}}">{{certinfo.0|uscore2space|title}} Accomplished</a>
{% empty %}
    {% if course in is_student_list %}
        <form style="display:inline" method="POST" action="{% url 'courses.views.unenroll' course.prefix course.suffix %}">
            {% csrf_token %}
            <input class="btn" type="Submit"  value="Unenroll as Student" onclick="return confirm('Do you really want to unenroll?')" />     
        </form>
    {% else %}
        Staff Member
        <a class="btn disabled">Staff Member</a>
    {% endif %}
{% endfor %}
```