title: Not able to get groups that belong to current user
body: <p>I'm building a Django app that needs two things. First, it needs the set of groups that the user has access to. With this set of groups, my template is supposed to create a button for each group. Next, it needs the set of "Property" objects that are ManyToMany related to a group in the previously found set of groups (this is to say that I need every property that is assigned to a group that the user has access to). For each of these properties, a button is created. I'm working with an admin user on localhost right now while building this, and I've created a test group with test properties and assigned the admin user to that group. Django however, doesn't seem to be detecting this. The relevant code is below:</p>
  
  <p>views.py</p>
  
  <pre><code>from __future__ import unicode_literals
  from django.shortcuts import render
  from UsageData.models import Property, User, Group, MeterData
  from django.contrib import auth    
  
  def reports_proerty_list(request):
  
      if request.user.is_authenticated():
  
          current_user_groups = Group.objects.filter(id__in=request.user.groups.all())
          current_user_properties = Property.objects.filter(groups__in=current_user_groups)
  
          return render(request, 'App/App-Template-Page.html')
  
      else:
  
          # The user is redirected to the sign-in page
  </code></pre>
  
  <p>App-Template-Page.html</p>
  
  <pre><code>        &lt;div class="row"&gt;
  
          {% if current_user_groups %}
              {% for group in current_user_groups %}
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;{{ group.name }}&lt;/button&gt;
              &lt;/div&gt;
              {% endfor %}
          {% else %}
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 1&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 2&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 3&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 4&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 5&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-sm-2 col-md-2 col-lg-2 text-center"&gt;
                  &lt;button class="tab-selector inactive" id="{{ group.id }}"&gt;Group 6&lt;/button&gt;
              &lt;/div&gt;
          {% endif %}
          &lt;/div&gt;
  </code></pre>
  
  <p>The problem I'm having is that the {% else %} part of the template displays when the page loads, which I suppose means that current_user_groups doesn't exist. Anyone know why this might be happening? I naturally can't proceed with what I want to do with the Property objects without this working first. Thanks!</p>