From 6d6a3a3d6b1ca50f69357a5aceabc63b91068d2c Mon Sep 17 00:00:00 2001 From: Adarnof Date: Thu, 10 May 2018 14:25:57 -0400 Subject: [PATCH] Allow viewing corpstats added by the user. Order corpstats by corp name. --- allianceauth/__init__.py | 2 +- allianceauth/corputils/views.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/allianceauth/__init__.py b/allianceauth/__init__.py index 8109e93c..51128fdf 100644 --- a/allianceauth/__init__.py +++ b/allianceauth/__init__.py @@ -1,7 +1,7 @@ # This will make sure the app is always imported when # Django starts so that shared_task will use this app. -__version__ = '2.0.1' +__version__ = '2.0.2' NAME = 'Alliance Auth v%s' % __version__ default_app_config = 'allianceauth.apps.AllianceAuthConfig' diff --git a/allianceauth/corputils/views.py b/allianceauth/corputils/views.py index 71b8f9c4..1114e9b2 100644 --- a/allianceauth/corputils/views.py +++ b/allianceauth/corputils/views.py @@ -17,7 +17,8 @@ SWAGGER_SPEC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sw def access_corpstats_test(user): return user.has_perm('corputils.view_corp_corpstats') or user.has_perm( - 'corputils.view_alliance_corpstats') or user.has_perm('corputils.view_state_corpstats') + 'corputils.view_alliance_corpstats') or user.has_perm('corputils.view_state_corpstats') or user.has_perm( + 'corputils.add_corpstats') @login_required @@ -62,7 +63,7 @@ def corpstats_view(request, corp_id=None): corpstats = get_object_or_404(CorpStats, corp=corp) # get available models - available = CorpStats.objects.visible_to(request.user) + available = CorpStats.objects.visible_to(request.user).order_by('corp__corporation_name') # ensure we can see the requested model if corpstats and corpstats not in available: