diff --git a/app.py b/app.py index bdfc9e4..af5e82d 100644 --- a/app.py +++ b/app.py @@ -32,6 +32,15 @@ def get_db_connection(): conn = psycopg2.connect(os.environ['DATABASE_URL']) return conn +@app.template_filter('image_url') +def image_url_filter(path): + """Convert image path to proper URL - handles both storage and local paths""" + if not path: + return url_for('static', filename='images/default.jpg') + if path.startswith('/storage/'): + return path + return url_for('static', filename=path) + def upload_file_to_storage(file, folder='uploads'): """ Upload file to object storage if available, otherwise fall back to local storage diff --git a/templates/admin/members.html b/templates/admin/members.html index 9717cd3..70feb4a 100644 --- a/templates/admin/members.html +++ b/templates/admin/members.html @@ -186,7 +186,7 @@
{{ mentor.role }}
@@ -205,7 +205,7 @@{{ member.role }}
diff --git a/templates/admin/sponsors.html b/templates/admin/sponsors.html index c7999ac..2db3bea 100644 --- a/templates/admin/sponsors.html +++ b/templates/admin/sponsors.html @@ -146,7 +146,7 @@ {% for sponsor in sponsors %}{{ mentor.role }}
@@ -63,7 +63,7 @@ {% for member in members %}{{ member.role }}
diff --git a/templates/sponsors.html b/templates/sponsors.html index c85ade1..ba8df56 100644 --- a/templates/sponsors.html +++ b/templates/sponsors.html @@ -16,7 +16,7 @@ {% for sponsor in sponsors %}