Spaces:
Runtime error
Runtime error
YoonJ-C
commited on
Commit
·
1495155
1
Parent(s):
9501e9b
Update rag_utils.py and script.js
Browse files- rag_utils.py +1 -1
- static/script.js +8 -4
rag_utils.py
CHANGED
|
@@ -8,7 +8,7 @@ def load_religions_from_csv(csv_path):
|
|
| 8 |
with open(csv_path, 'r', encoding='utf-8') as f:
|
| 9 |
reader = csv.DictReader(f)
|
| 10 |
for row in reader:
|
| 11 |
-
religions[row['
|
| 12 |
print(f"✅ Loaded {len(religions)} religions from CSV")
|
| 13 |
return religions
|
| 14 |
except Exception as e:
|
|
|
|
| 8 |
with open(csv_path, 'r', encoding='utf-8') as f:
|
| 9 |
reader = csv.DictReader(f)
|
| 10 |
for row in reader:
|
| 11 |
+
religions[row['religion']] = row
|
| 12 |
print(f"✅ Loaded {len(religions)} religions from CSV")
|
| 13 |
return religions
|
| 14 |
except Exception as e:
|
static/script.js
CHANGED
|
@@ -8,8 +8,10 @@ function sanitizeReligionName(name) {
|
|
| 8 |
// Google Sign-In with Firebase
|
| 9 |
async function signInWithGoogle() {
|
| 10 |
if (!window.firebaseEnabled || !window.firebaseAuth) {
|
| 11 |
-
document.getElementById('result')
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
return;
|
| 14 |
}
|
| 15 |
|
|
@@ -51,8 +53,10 @@ async function signInWithGoogle() {
|
|
| 51 |
if (data.success) {
|
| 52 |
window.location.href = '/assessment';
|
| 53 |
} else {
|
| 54 |
-
document.getElementById('result')
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
} catch (error) {
|
| 58 |
console.error('Google Sign-In Error:', error);
|
|
|
|
| 8 |
// Google Sign-In with Firebase
|
| 9 |
async function signInWithGoogle() {
|
| 10 |
if (!window.firebaseEnabled || !window.firebaseAuth) {
|
| 11 |
+
const resultDiv = document.getElementById('result');
|
| 12 |
+
if (resultDiv) {
|
| 13 |
+
resultDiv.innerHTML = '<p class="error-msg">⚠️ Firebase not configured</p>';
|
| 14 |
+
}
|
| 15 |
return;
|
| 16 |
}
|
| 17 |
|
|
|
|
| 53 |
if (data.success) {
|
| 54 |
window.location.href = '/assessment';
|
| 55 |
} else {
|
| 56 |
+
const resultDiv = document.getElementById('result');
|
| 57 |
+
if (resultDiv) {
|
| 58 |
+
resultDiv.innerHTML = `<p class="error-msg">${data.message || 'Authentication failed'}</p>`;
|
| 59 |
+
}
|
| 60 |
}
|
| 61 |
} catch (error) {
|
| 62 |
console.error('Google Sign-In Error:', error);
|