Skip to content

Commit 3e65060

Browse files
committed
refactor: optimize speakers feature code
1 parent 9cea80d commit 3e65060

4 files changed

Lines changed: 2 additions & 13 deletions

File tree

app/home/templates/home/sections/speakers-section.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ <h2 class="font-td_pinoy text-6xl text-orange-2 text-center m-0">Speakers</h2>
5454
{% if speaker.avatar_url %}
5555
<div class="rounded-[24px] flex flex-col gap-5 w-full max-w-[100%] lg:max-w-[250px] grow items-center">
5656
<div class="overflow-hidden flex-shrink-0 w-[250px] h-[250px]">
57-
{% if speaker.avatar_url %}
5857
<img src="{{ speaker.avatar_url }}" class="w-[250px] h-[250px] object-cover rounded-[85px]"
5958
alt="{{ speaker.name }} - Image" width="250" height="250">
60-
{% else %}
61-
<img src="{% static 'img/speakers/speakers-img-1.jpg' %}" class="w-[250px] h-[250px] object-cover rounded-[85px]"
62-
alt="{{ speaker.name }} - Image" width="250" height="250">
63-
{% endif %}
6459
</div>
6560
<div>
6661
<h3 class="font-bantayog text-brown-1 text-2xl uppercase">{{ speaker.name }}</h3>

app/home/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_sponsors(self):
2626

2727
def get_context_data(self, **kwargs):
2828
context = super().get_context_data(**kwargs)
29-
service = PretalxService(base_url="https://pretalx.com")
29+
service = PretalxService()
3030
context["sponsors_by_type"] = self.get_sponsors()
3131
featured_speakers = Speaker.objects.filter(is_featured=True).order_by("first_name", "last_name")
3232
context["featured_speakers"] = featured_speakers

config/environment.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,4 @@ def get_db_config(self):
5858
return {"NAME": name, "HOST": host, "USER": user, "PASSWORD": pwd, "PORT": 5432}
5959

6060

61-
settings = Settings(
62-
PRETALX=PretalxConfig(
63-
BASE_URL="https://pretalx.com",
64-
)
65-
)
61+
settings = Settings()

services/pretalx_service.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import json
2-
31
import requests
42
from django.core.cache import cache
53

0 commit comments

Comments
 (0)