Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Oct 18, 2021
2 parents 9d87445 + 769a505 commit e3b06a1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
28 changes: 26 additions & 2 deletions app/assets/v2/js/grants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -536,7 +560,7 @@ if (document.getElementById('grants-showcase')) {
}
// round has ended
return 'ended';

}

if (currentCLR) {
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 9 additions & 8 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e3b06a1

Please sign in to comment.