diff --git a/app/assets/v2/js/grants/index.js b/app/assets/v2/js/grants/index.js index bc8e4756eee..ac15b97cef4 100644 --- a/app/assets/v2/js/grants/index.js +++ b/app/assets/v2/js/grants/index.js @@ -481,7 +481,31 @@ if (document.getElementById('grants-showcase')) { showFilter() { let vm = this; - return JSON.stringify(vm.params) != JSON.stringify(baseParams); + let show_filter = false; + + const keys = [ + 'limit', + 'me', + 'sort_option', + 'network', + 'state', + 'profile', + 'sub_round_slug', + 'collections_page', + 'grant_regions', + 'grant_types', + 'grant_tags', + 'tenants', + 'idle', + ] + + keys.forEach(key => { + if (vm.params[key].toString() != baseParams[key].toString()) { + show_filter = true; + } + }) + + return show_filter; } }, computed: { @@ -536,7 +560,7 @@ if (document.getElementById('grants-showcase')) { } // round has ended return 'ended'; - + } if (currentCLR) { diff --git a/app/dashboard/admin.py b/app/dashboard/admin.py index dacd14703be..ae96c8b6512 100644 --- a/app/dashboard/admin.py +++ b/app/dashboard/admin.py @@ -361,7 +361,7 @@ def response_change(self, request, obj): # Register your models here. class BountyAdmin(admin.ModelAdmin): - raw_id_fields = ['interested', 'bounty_owner_profile', 'bounty_reserved_for_user'] + raw_id_fields = ['interested', 'coupon_code', 'org', 'event', 'bounty_owner_profile', 'bounty_reserved_for_user'] ordering = ['-id'] search_fields = ['raw_data', 'title', 'bounty_owner_github_username', 'token_name'] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index cb28a2fe150..042d850d352 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -4025,7 +4025,7 @@ def get_absolute_url(self): def url(self): return self.get_absolute_url() - def get_access_token(self, save=True): + def get_access_token(self, save=False): """Get the Github access token from User. Args: diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 2fb74ee6f74..3dc65dd3482 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -3818,6 +3818,7 @@ def profile_filter_activities(activities, activity_name, activity_tabs): def profile(request, handle, tab=None): """Display profile details. + Args: handle (str): The profile handle. @@ -3838,7 +3839,6 @@ def profile(request, handle, tab=None): handle = handle.replace("@", "") # perf disable_cache = False - # make sure tab param is correct all_tabs = ['bounties', 'projects', 'manage', 'active', 'ratings', 'follow', 'portfolio', 'viewers', 'activity', 'resume', 'kudos', 'earnings', 'spent', 'orgs', 'people', 'grants', 'quests', 'tribe', 'hackathons', 'trust'] tab = default_tab if tab not in all_tabs else tab @@ -3913,7 +3913,7 @@ def profile(request, handle, tab=None): ) if request.user.is_authenticated and hasattr(request.user, 'profile'): - context['is_on_tribe'] = request.user.profile.tribe_members.filter(org__handle=handle.lower()).exists() + context['is_on_tribe'] = request.user.profile.tribe_members.filter(org=profile).exists() else: context['is_on_tribe'] = False @@ -3973,12 +3973,13 @@ def profile(request, handle, tab=None): follow_page_size = 10 page_number = request.GET.get('page', 1) - context['all_followers'] = TribeMember.objects.filter(org=profile).order_by('pk') - context['all_following'] = TribeMember.objects.filter(profile=profile).order_by('pk') - context['following'] = Paginator(context['all_following'], follow_page_size).get_page(page_number) - context['followers'] = Paginator(context['all_followers'], follow_page_size).get_page(page_number) - context['foltab'] = request.GET.get('sub', 'followers') - context['page_obj'] = context['followers'] if context['foltab'] == 'followers' else context['following'] + if tab == 'people': + context['all_followers'] = TribeMember.objects.filter(org=profile).order_by('pk') + context['all_following'] = TribeMember.objects.filter(profile=profile).order_by('pk') + context['following'] = Paginator(context['all_following'], follow_page_size).get_page(page_number) + context['followers'] = Paginator(context['all_followers'], follow_page_size).get_page(page_number) + context['foltab'] = request.GET.get('sub', 'followers') + context['page_obj'] = context['followers'] if context['foltab'] == 'followers' else context['following'] tab = get_profile_tab(request, profile, tab, context) if type(tab) == dict: