Skip to content

Commit 6d5957a

Browse files
committed
Fixing participated hackathons function
1 parent 5ce1f24 commit 6d5957a

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

accounts/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,12 @@ def timezone_to_offset(self):
149149
offset = datetime.now(pytz.timezone(self.timezone)).strftime('%z')
150150
return f'UTC{offset[:-2]}'
151151

152-
def participant_label(self):
153-
teams = self.participated_hackteams.filter(
152+
def get_participated_teams(self):
153+
return self.participated_hackteams.filter(
154154
hackathon__status='finished')
155+
156+
def participant_label(self):
157+
teams = self.get_participated_teams()
155158
if teams.count() == 0:
156159
return 'Hackathon Newbie'
157160
elif teams.count() < 2:

profiles/templates/profiles/profile.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@
9393

9494
<label for="userTeamCount">Hackathons Joined</label>
9595
<p id="userTeamCount">
96-
{{ user.teams.all|length }}
96+
{{ user.get_participated_teams|length }}
9797
</p>
9898
<label for="userHackathons">List of Hackathons Joined</label>
99-
{% if user.teams.all %}
99+
{% if user.get_participated_teams %}
100100
<ul id="userHackathons">
101-
{% for team in user.teams.all %}
101+
{% for team in user.get_participated_teams %}
102102
<li>
103-
<a href="{% url 'hackathon_detail' team.hackathon.slug %}">{{ team.hackathon.name }}</a>
103+
<a href="{% url 'hackathon:view_hackathon' team.hackathon.id %}" class="profile-url">{{ team.hackathon.display_name }}</a>
104104
</li>
105105
{% endfor %}
106106
</ul>
@@ -111,7 +111,7 @@
111111
<label for="website">Website</label>
112112
<p id="website" class="profile-website-url">
113113
{% if user.website_url %}
114-
<a href="{{ user.website_url }}" target="_blank">
114+
<a href="{{ user.website_url }}" target="_blank" class="profile-url">
115115
{{ user.website_url }}
116116
</a>
117117
{% else %}N/A{% endif %}

static/css/profile.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
display: block;
4747
}
4848

49+
.card .card-body a.profile-url {
50+
font-size: 1rem;
51+
}
52+
4953
.card .card-body p.profile-website-url a {
5054
text-transform: lowercase;
51-
font-size: 1rem;
5255
}
5356
/* For specific color targeting of 'o' chars in keeping with the CI Logo */
5457

@@ -66,4 +69,4 @@ hr.thick {
6669
html form label,
6770
.dark-text {
6871
font-weight: 700;
69-
}
72+
}

0 commit comments

Comments
 (0)