Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit eff7cc7

Browse files
committed
cleaning up the code
1 parent b2f456e commit eff7cc7

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

static/scss/_768up.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
li {
2424
width:50%;
2525
}
26-
}
26+
}

static/scss/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ SCOREBOARD STYLES
563563
}
564564
@for $i from 1 through 10 {
565565
li:nth-child(#{$i}) {
566-
background-color: #F0F8FF;
566+
background-color: #F0F8FF;
567567
}
568568
}
569569

web/processors/event.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from web.processors import media
1111
from mailer.event_report_mailer import send_email_to_country_ambassadors
1212

13+
1314
def get_client_ip(forwarded=None, remote=None):
1415

1516
if settings.DEBUG:
@@ -119,14 +120,15 @@ def get_country(country_code, user_ip):
119120
country = get_country_from_user_ip(user_ip)
120121
return country
121122

123+
122124
def count_approved_events_for_country(past=True):
123125
"""
124126
Count the number of approved events and score for each country
125127
"""
126128

127129
all_events = Event.objects.filter(status='APPROVED')
128130

129-
country_counts = []
131+
country_count = []
130132

131133
# not including the first two fake countries in the list
132134
for country in list(countries)[2:]:
@@ -141,10 +143,10 @@ def count_approved_events_for_country(past=True):
141143
'country_name': country_name,
142144
'events': number_of_events,
143145
'score': country_score}
144-
country_counts.append(country_entry)
146+
country_count.append(country_entry)
145147

146-
sorted_counts = sorted(country_counts, key=lambda k: k['score'], reverse=True)
147-
return sorted_counts
148+
sorted_count = sorted(country_count, key=lambda k: k['score'], reverse=True)
149+
return sorted_count
148150

149151

150152
def change_event_status(event_id):

web/templates/pages/scoreboard.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ <h1>#codeEU Events Scoreboard</h1>
1717
</li>
1818
{% endfor %}
1919
</ul>
20-
2120
</div>
22-
{% endblock content %}
21+
{% endblock content %}

web/views/events.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,6 @@ def search_events(request):
313313
def scoreboard(request):
314314
template = 'pages/scoreboard.html'
315315

316-
user_ip = get_client_ip(forwarded=request.META.get('HTTP_X_FORWARDED_FOR'),
317-
remote=request.META.get('REMOTE_ADDR'))
318-
country = get_country_from_user_ip(user_ip)
319-
320316
counts = count_approved_events_for_country()
321317

322318
return render_to_response(

0 commit comments

Comments
 (0)