Spaces:
Sleeping
Sleeping
edited def init for unsplash class
Browse files
app.py
CHANGED
|
@@ -109,16 +109,11 @@ class UnsplashAPI:
|
|
| 109 |
"""Simple Unsplash API integration"""
|
| 110 |
|
| 111 |
def __init__(self, access_key=None):
|
| 112 |
-
|
| 113 |
if access_key:
|
| 114 |
self.access_key = access_key
|
| 115 |
else:
|
| 116 |
-
|
| 117 |
-
try:
|
| 118 |
-
self.access_key = st.secrets.get("UNSPLASH_ACCESS_KEY")
|
| 119 |
-
except (FileNotFoundError, KeyError, AttributeError):
|
| 120 |
-
# Fall back to environment variable
|
| 121 |
-
self.access_key = os.environ.get("UNSPLASH_ACCESS_KEY")
|
| 122 |
|
| 123 |
self.base_url = "https://api.unsplash.com"
|
| 124 |
|
|
|
|
| 109 |
"""Simple Unsplash API integration"""
|
| 110 |
|
| 111 |
def __init__(self, access_key=None):
|
| 112 |
+
# Use environment variable only - no secrets.toml warning
|
| 113 |
if access_key:
|
| 114 |
self.access_key = access_key
|
| 115 |
else:
|
| 116 |
+
self.access_key = os.environ.get("UNSPLASH_ACCESS_KEY")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
self.base_url = "https://api.unsplash.com"
|
| 119 |
|