dannyroxas commited on
Commit
818f78c
·
verified ·
1 Parent(s): 65e1fbd

edited def init for unsplash class

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -109,16 +109,11 @@ class UnsplashAPI:
109
  """Simple Unsplash API integration"""
110
 
111
  def __init__(self, access_key=None):
112
- # Try to get from provided key, Streamlit secrets, or environment
113
  if access_key:
114
  self.access_key = access_key
115
  else:
116
- # Try secrets first, but handle the case where secrets don't exist
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