Skip to content

Commit

Permalink
Fix #520: ellipsis menu visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Ross committed Aug 8, 2016
1 parent 12181ab commit f643a8c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
16 changes: 5 additions & 11 deletions cadasta/organization/views/default.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import os
import json
from django.http import Http404, HttpResponse
from django.http import HttpResponse
from django.db import transaction
from django.shortcuts import redirect, get_object_or_404
import django.views.generic as base_generic
from django.core.urlresolvers import reverse
from django.utils.translation import gettext as _
from django.contrib import messages

import formtools.wizard.views as wizard
Expand Down Expand Up @@ -308,6 +307,7 @@ def get(self, request, *args, **kwargs):

class ProjectDashboard(PermissionRequiredMixin,
mixins.ProjectAdminCheckMixin,
mixins.ProjectMixin,
generic.DetailView):
def get_actions(view, request):
if view.get_object().public():
Expand Down Expand Up @@ -338,15 +338,7 @@ def get_context_data(self, **kwargs):
return context

def get_object(self, queryset=None):
queryset = Project.objects.filter(
organization__slug=self.kwargs.get('organization'),
slug=self.kwargs.get('project')
)
try:
obj = queryset.get()
except queryset.model.DoesNotExist:
raise Http404(_("No projects found matching the query"))
return obj
return self.get_project()


PROJECT_ADD_FORMS = [('extents', forms.ProjectAddExtents),
Expand Down Expand Up @@ -489,6 +481,7 @@ def done(self, form_list, form_dict, **kwargs):


class ProjectEdit(mixins.ProjectMixin,
mixins.ProjectAdminCheckMixin,
LoginPermissionRequiredMixin):
model = Project
permission_required = 'project.update'
Expand Down Expand Up @@ -559,6 +552,7 @@ class ProjectUnarchive(ProjectEdit, ArchiveMixin, generic.DetailView):

class ProjectDataDownload(mixins.ProjectMixin,
LoginPermissionRequiredMixin,
mixins.ProjectAdminCheckMixin,
base_generic.edit.FormMixin,
generic.DetailView):
template_name = 'organization/project_download.html'
Expand Down
4 changes: 2 additions & 2 deletions cadasta/organization/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def is_administrator(self):
su_role = Role.objects.filter(name='superuser')
org_admins = [
role.user for role in OrganizationRole.objects.filter(
organization=self.get_object().organization,
organization=self.get_project().organization,
admin=True
)
]
proj_managers = [
role.user for role in ProjectRole.objects.filter(
project=self.get_object(),
project=self.get_project(),
role='PM'
)

Expand Down
2 changes: 2 additions & 0 deletions cadasta/resources/views/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
from core.mixins import LoginPermissionRequiredMixin

from . import mixins
from organization.views import mixins as organization_mixins
from ..forms import AddResourceFromLibraryForm
from .. import messages as error_messages


class ProjectResources(LoginPermissionRequiredMixin,
mixins.ProjectResourceMixin,
mixins.ProjectHasResourcesMixin,
organization_mixins.ProjectAdminCheckMixin,
generic.ListView):
template_name = 'resources/project_list.html'
permission_required = 'resource.list'
Expand Down
2 changes: 2 additions & 0 deletions cadasta/spatial/views/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
from resources.views.mixins import ProjectHasResourcesMixin
from party.messages import TENURE_REL_CREATE
from . import mixins
from organization.views import mixins as organization_mixins
from .. import forms
from ..serializers import SpatialUnitGeoJsonSerializer
from .. import messages as error_messages


class LocationsList(LoginPermissionRequiredMixin,
mixins.SpatialQuerySetMixin,
organization_mixins.ProjectAdminCheckMixin,
generic.ListView):
template_name = 'spatial/location_map.html'
permission_required = 'spatial.list'
Expand Down

0 comments on commit f643a8c

Please sign in to comment.