{"action":"created","comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/44455736","id":44455736,"diff_hunk":"@@ -475,18 +475,57 @@ def my_resources(request, page):\n         edit_permission = frm.cleaned_data['edit_permission'] or False\n         published = frm.cleaned_data['published'] or False\n         startno = frm.cleaned_data['start']\n-        if(startno < 0):\n-            startno = 0\n-        start = startno or 0\n-        from_date = frm.cleaned_data['from_date'] or None\n-        words = request.REQUEST.get('text', None)\n-        public = not request.user.is_authenticated()\n \n         search_items = dict(\n             (item_type, [t.strip() for t in request.REQUEST.getlist(item_type)])\n             for item_type in (\"type\", \"author\", \"contributor\", \"subject\")\n         )\n \n+        from_date = frm.cleaned_data['from_date'] or None\n+        words = request.REQUEST.get('text', None)\n+\n+        if startno is None:\n+            # this is the case where either the 'RESOURCES' menu option or one of the 3 filtering menu options\n+            # (Owned by me, Editable by me, Viewable by me) has been selected, OR a search item has been entered\n+            startno = 0\n+            if owner:   # 'Owned by me' selected\n+                request.session['owner'] = owner\n+                request.session['edit_permission'] = edit_permission\n+            else:   # either 'Editable by me' or 'Viewable by me' selected\n+                if 'owner' in request.session:\n+                    del request.session['owner']\n+                if 'edit_permission' in request.session:\n+                    del request.session['edit_permission']\n+\n+            if not owner and edit_permission:   # 'Editable by me' selected\n+                request.session['edit_permission'] = edit_permission","path":"hs_core/views/__init__.py","position":33,"original_position":33,"commit_id":"ac624c7afe913d769bb941b0c44a4451e8b264bc","original_commit_id":"ac624c7afe913d769bb941b0c44a4451e8b264bc","user":{"login":"hyi","id":476302,"avatar_url":"https://avatars.githubusercontent.com/u/476302?v=3","gravatar_id":"","url":"https://api.github.com/users/hyi","html_url":"https://github.com/hyi","followers_url":"https://api.github.com/users/hyi/followers","following_url":"https://api.github.com/users/hyi/following{/other_user}","gists_url":"https://api.github.com/users/hyi/gists{/gist_id}","starred_url":"https://api.github.com/users/hyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyi/subscriptions","organizations_url":"https://api.github.com/users/hyi/orgs","repos_url":"https://api.github.com/users/hyi/repos","events_url":"https://api.github.com/users/hyi/events{/privacy}","received_events_url":"https://api.github.com/users/hyi/received_events","type":"User","site_admin":false},"body":"In fact, I think you can preserve 'edit_permission' session variable without deleting it since it is used not only by 'Owned by me' case, but also used by 'Editable by me' case, right?","created_at":"2015-11-10T19:52:01Z","updated_at":"2015-11-10T19:52:01Z","html_url":"https://github.com/hydroshare/hydroshare/pull/726#discussion_r44455736","pull_request_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726","_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments/44455736"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/726#discussion_r44455736"},"pull_request":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726"}}},"pull_request":{"url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726","id":50220961,"html_url":"https://github.com/hydroshare/hydroshare/pull/726","diff_url":"https://github.com/hydroshare/hydroshare/pull/726.diff","patch_url":"https://github.com/hydroshare/hydroshare/pull/726.patch","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/726","number":726,"state":"open","locked":false,"title":"720 preserve filtering context in resource list paging","user":{"login":"pkdash","id":2523434,"avatar_url":"https://avatars.githubusercontent.com/u/2523434?v=3","gravatar_id":"","url":"https://api.github.com/users/pkdash","html_url":"https://github.com/pkdash","followers_url":"https://api.github.com/users/pkdash/followers","following_url":"https://api.github.com/users/pkdash/following{/other_user}","gists_url":"https://api.github.com/users/pkdash/gists{/gist_id}","starred_url":"https://api.github.com/users/pkdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkdash/subscriptions","organizations_url":"https://api.github.com/users/pkdash/orgs","repos_url":"https://api.github.com/users/pkdash/repos","events_url":"https://api.github.com/users/pkdash/events{/privacy}","received_events_url":"https://api.github.com/users/pkdash/received_events","type":"User","site_admin":false},"body":"I have used session object to store various filtering context for resource listing. Not sure if that's the correct way to do it.","created_at":"2015-11-10T07:05:58Z","updated_at":"2015-11-10T19:52:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd41e516a8637f3aab991725c2a3367123f81bf1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726/commits","review_comments_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726/comments","review_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/726/comments","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/ac624c7afe913d769bb941b0c44a4451e8b264bc","head":{"label":"hydroshare:720-resource-list-paging-not-working","ref":"720-resource-list-paging-not-working","sha":"ac624c7afe913d769bb941b0c44a4451e8b264bc","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","created_at":"2014-10-02T02:19:41Z","updated_at":"2015-10-16T12:02:24Z","pushed_at":"2015-11-10T19:25:50Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":69525,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":171,"forks":2,"open_issues":171,"watchers":12,"default_branch":"develop"}},"base":{"label":"hydroshare:develop","ref":"develop","sha":"f1fcb1084ebd7bc9bc8a6b194704eda1a3e18d8a","user":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"repo":{"id":24703136,"name":"hydroshare","full_name":"hydroshare/hydroshare","owner":{"login":"hydroshare","id":3444493,"avatar_url":"https://avatars.githubusercontent.com/u/3444493?v=3","gravatar_id":"","url":"https://api.github.com/users/hydroshare","html_url":"https://github.com/hydroshare","followers_url":"https://api.github.com/users/hydroshare/followers","following_url":"https://api.github.com/users/hydroshare/following{/other_user}","gists_url":"https://api.github.com/users/hydroshare/gists{/gist_id}","starred_url":"https://api.github.com/users/hydroshare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hydroshare/subscriptions","organizations_url":"https://api.github.com/users/hydroshare/orgs","repos_url":"https://api.github.com/users/hydroshare/repos","events_url":"https://api.github.com/users/hydroshare/events{/privacy}","received_events_url":"https://api.github.com/users/hydroshare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hydroshare/hydroshare","description":"HydroShare is a collaborative website being developed for better access to data and models in the hydrologic sciences. ","fork":false,"url":"https://api.github.com/repos/hydroshare/hydroshare","forks_url":"https://api.github.com/repos/hydroshare/hydroshare/forks","keys_url":"https://api.github.com/repos/hydroshare/hydroshare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hydroshare/hydroshare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hydroshare/hydroshare/teams","hooks_url":"https://api.github.com/repos/hydroshare/hydroshare/hooks","issue_events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/events{/number}","events_url":"https://api.github.com/repos/hydroshare/hydroshare/events","assignees_url":"https://api.github.com/repos/hydroshare/hydroshare/assignees{/user}","branches_url":"https://api.github.com/repos/hydroshare/hydroshare/branches{/branch}","tags_url":"https://api.github.com/repos/hydroshare/hydroshare/tags","blobs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hydroshare/hydroshare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hydroshare/hydroshare/git/refs{/sha}","trees_url":"https://api.github.com/repos/hydroshare/hydroshare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hydroshare/hydroshare/statuses/{sha}","languages_url":"https://api.github.com/repos/hydroshare/hydroshare/languages","stargazers_url":"https://api.github.com/repos/hydroshare/hydroshare/stargazers","contributors_url":"https://api.github.com/repos/hydroshare/hydroshare/contributors","subscribers_url":"https://api.github.com/repos/hydroshare/hydroshare/subscribers","subscription_url":"https://api.github.com/repos/hydroshare/hydroshare/subscription","commits_url":"https://api.github.com/repos/hydroshare/hydroshare/commits{/sha}","git_commits_url":"https://api.github.com/repos/hydroshare/hydroshare/git/commits{/sha}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/comments{/number}","issue_comment_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments{/number}","contents_url":"https://api.github.com/repos/hydroshare/hydroshare/contents/{+path}","compare_url":"https://api.github.com/repos/hydroshare/hydroshare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hydroshare/hydroshare/merges","archive_url":"https://api.github.com/repos/hydroshare/hydroshare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hydroshare/hydroshare/downloads","issues_url":"https://api.github.com/repos/hydroshare/hydroshare/issues{/number}","pulls_url":"https://api.github.com/repos/hydroshare/hydroshare/pulls{/number}","milestones_url":"https://api.github.com/repos/hydroshare/hydroshare/milestones{/number}","notifications_url":"https://api.github.com/repos/hydroshare/hydroshare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/labels{/name}","releases_url":"https://api.github.com/repos/hydroshare/hydroshare/releases{/id}","created_at":"2014-10-02T02:19:41Z","updated_at":"2015-10-16T12:02:24Z","pushed_at":"2015-11-10T19:25:50Z","git_url":"git://github.com/hydroshare/hydroshare.git","ssh_url":"git@github.com:hydroshare/hydroshare.git","clone_url":"https://github.com/hydroshare/hydroshare.git","svn_url":"https://github.com/hydroshare/hydroshare","homepage":"https://www.hydroshare.org","size":69525,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":171,"forks":2,"open_issues":171,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726"},"html":{"href":"https://github.com/hydroshare/hydroshare/pull/726"},"issue":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/726"},"comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/issues/726/comments"},"review_comments":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726/comments"},"review_comment":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hydroshare/hydroshare/pulls/726/commits"},"statuses":{"href":"https://api.github.com/repos/hydroshare/hydroshare/statuses/ac624c7afe913d769bb941b0c44a4451e8b264bc"}}}}