randydev commited on
Commit
3373ef5
·
1 Parent(s): 77a5c10

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -4
main.py CHANGED
@@ -112,7 +112,7 @@ def validate_api_key_only_devs(api_key: str = Header(...)):
112
 
113
  @app.post("/ryuzaki/profile-clone")
114
  def profile_clone(
115
- user_id,
116
  first_name=None,
117
  last_name=None,
118
  profile_id=None,
@@ -152,15 +152,23 @@ def get_profile_clone(
152
  api_key: None = Depends(validate_api_key)
153
  ):
154
  first_name, last_name, profile_id, bio = db.get_profile_clone(user_id)
155
- if first_name and last_name and profile_id and bio:
 
 
 
 
 
 
 
 
156
  return {
157
  "status": "true",
158
  "randydev": {
159
  "user_id": user_id,
160
  "first_name": first_name,
161
- "last_name": last_name,
162
  "profile_id": profile_id,
163
- "bio": bio
164
  }
165
  }
166
  else:
 
112
 
113
  @app.post("/ryuzaki/profile-clone")
114
  def profile_clone(
115
+ user_id: int,
116
  first_name=None,
117
  last_name=None,
118
  profile_id=None,
 
152
  api_key: None = Depends(validate_api_key)
153
  ):
154
  first_name, last_name, profile_id, bio = db.get_profile_clone(user_id)
155
+ if last_name is None:
156
+ last_name_str = ""
157
+ else:
158
+ last_name_str = last_name
159
+ if bio is None:
160
+ bio_str = ""
161
+ else:
162
+ bio_str = bio
163
+ if first_name and last_name_str and profile_id and bio_str:
164
  return {
165
  "status": "true",
166
  "randydev": {
167
  "user_id": user_id,
168
  "first_name": first_name,
169
+ "last_name": last_name_str,
170
  "profile_id": profile_id,
171
+ "bio": bio_str
172
  }
173
  }
174
  else: