Jon Solow
commited on
Commit
·
97eb4b4
1
Parent(s):
556be95
Fix json loads and copying of connections
Browse files- src/login.py +10 -5
src/login.py
CHANGED
@@ -20,12 +20,17 @@ class HFFriendlyGSheetsConnection(GSheetsConnection):
|
|
20 |
if secrets_singleton.load_if_toml_exists():
|
21 |
connections_section = AttrDict(secrets_singleton)
|
22 |
|
|
|
23 |
# in hf env the private key may need json loads
|
24 |
-
private_key =
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
|
30 |
|
31 |
conn = st.connection("gsheets", type=HFFriendlyGSheetsConnection)
|
|
|
20 |
if secrets_singleton.load_if_toml_exists():
|
21 |
connections_section = AttrDict(secrets_singleton)
|
22 |
|
23 |
+
connections_copy = connections_section.to_dict()
|
24 |
# in hf env the private key may need json loads
|
25 |
+
private_key = connections_copy["private_key"]
|
26 |
+
try:
|
27 |
+
private_key = json.loads(private_key)
|
28 |
+
except Exception:
|
29 |
+
pass
|
30 |
+
connections_copy["private_key"] = private_key
|
31 |
+
st.write(connections_copy)
|
32 |
+
|
33 |
+
return AttrDict(connections_copy)
|
34 |
|
35 |
|
36 |
conn = st.connection("gsheets", type=HFFriendlyGSheetsConnection)
|