Repository: akvo/akvo-rsr

Issue:
View for projects with no results framework but using RSR Updates loads with error
For the redesigned MyRSR ... Some projects only use RSR Updates, i.e. they do not use the Results Framework. When you click/open a project to view in the new MyRSR you get this message: 

<img width="1438" alt="no results framework" src="https://user-images.githubusercontent.com/26227538/36594059-e1fa1a74-189c-11e8-8ad2-fd046ea7db36.png">

For these projects the view should look like this: 

![rsr udate view](https://user-images.githubusercontent.com/26227538/36594081-0120e630-189d-11e8-9bcf-da924928b0ce.png)



Discussion:

Resolving patch:
diff --git a/akvo/rsr/views/my_rsr.py b/akvo/rsr/views/my_rsr.py
--- a/akvo/rsr/views/my_rsr.py
+++ b/akvo/rsr/views/my_rsr.py
@@ -22,6 +22,7 @@
 from akvo.codelists.models import Country, Version
 from akvo.codelists.store.codelists_v202 import SECTOR_CATEGORY, SECTOR
 from akvo.rsr.models import IndicatorPeriodData
+from .utils import toJSBoolean
 
 from ..forms import (PasswordForm, ProfileForm, UserOrganisationForm, UserAvatarForm,
                      SelectOrgForm)
@@ -506,32 +507,14 @@ def user_management(request):
 
 
 @login_required
-def my_results_select(request):
-    """
-    My results section without a project selected. Only accessible to M&E Managers, Admins and
-    Project editors.
+def my_project(request, project_id, template='myrsr/my_project.html'):
+    """Project results, updates and reports CRUD view
 
-    :param request; A Django HTTP request and context
-    """
-    user = request.user
-    me_managers = Group.objects.get(name='M&E Managers')
-    admins = Group.objects.get(name='Admins')
-    project_editors = Group.objects.get(name='Project Editors')
-
-    if not (user.is_admin or user.is_superuser or user.in_group(me_managers) or
-            user.in_group(admins) or user.in_group(project_editors)):
-        raise PermissionDenied
-
-    return render(request, 'myrsr/my_results_select.html', {})
-
-
-@login_required
-def my_results(request, project_id, template='myrsr/my_results.html'):
-    """
-    My results section. Only accessible to M&E Managers, Admins and Project editors.
+    Only accessible to M&E Managers, Admins and Project editors.
 
     :param request; A Django HTTP request and context
     :param project_id; The ID of the project
+
     """
     project = get_object_or_404(Project, pk=project_id)
     user = request.user
@@ -554,10 +537,10 @@ def my_results(request, project_id, template='myrsr/my_results.html'):
         'project': project,
         'user': user,
         # turn it into JSON boolean
-        'user_is_me_manager': 'true' if user_is_me_manager else 'false',
+        'user_is_me_manager': toJSBoolean(user_is_me_manager),
         'me_managers': me_managers.exists(),
         'update_statuses': json.dumps(dict(IndicatorPeriodData.STATUSES)),
-        'show_narrative_reports': 'true' if show_narrative_reports else 'false',
+        'show_narrative_reports': toJSBoolean(show_narrative_reports),
     }
 
     return render(request, template, context)
diff --git a/akvo/rsr/views/utils.py b/akvo/rsr/views/utils.py
--- a/akvo/rsr/views/utils.py
+++ b/akvo/rsr/views/utils.py
@@ -54,3 +54,7 @@ def org_projects(organisation):
 def show_filter_class(qs, filters):
     """To simplify template, instead of bool adhere to bootstrap class name."""
     return "" if frozenset(qs.keys()).isdisjoint(filters) else "in"
+
+
+def toJSBoolean(bool):
+    return 'true' if bool else 'false'
diff --git a/akvo/urls.py b/akvo/urls.py
--- a/akvo/urls.py
+++ b/akvo/urls.py
@@ -103,10 +103,8 @@
     url(r'^myrsr/$',
         'akvo.rsr.views.my_rsr.my_rsr', name='my_rsr'),
 
-    url(r'^myrsr/project/(?P<project_id>\d+)/$',
-        'akvo.rsr.views.my_rsr.my_results',
-        kwargs=dict(template='myrsr/project.html'),
-        name='project-edit'),
+    url(r'^myrsr/my_project/(?P<project_id>\d+)/$',
+        'akvo.rsr.views.my_rsr.my_project', name='project-edit'),
 
     url(r'^myrsr/details/$',
         'akvo.rsr.views.my_rsr.my_details', name='my_details'),
@@ -126,12 +124,6 @@
     url(r'^myrsr/reports/$',
         'akvo.rsr.views.my_rsr.my_reports', name='my_reports'),
 
-    url(r'^myrsr/results/$',
-        'akvo.rsr.views.my_rsr.my_results_select', name='my_results_select'),
-
-    url(r'^myrsr/results/(?P<project_id>\d+)/$',
-        'akvo.rsr.views.my_rsr.my_results', name='my_results'),
-
     url(r'^myrsr/user_management/$',
         'akvo.rsr.views.my_rsr.user_management', name='user_management'),
 


Test patch: