MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / set_profile

Function set_profile

Scripts/ButSystem.py:3316–3372  ·  view source on GitHub ↗

set_profile. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: username: Parameter. nickname: Parameter. bio: Parameter. links: Parameter. extras: Parameter. Returns: Varies.

(username: str, nickname: str, bio: str, links: List[str], extras: Optional[Dict[str, str]] = None)

Source from the content-addressed store, hash-verified

3314 return False
3315
3316def ensure_profile_row(username: str):
3317 """ensure_profile_row.
3318
3319Route handler or application helper.
3320
3321This docstring was expanded to make future maintenance easier.
3322
3323Args:
3324 username: Parameter.
3325
3326Returns:
3327 Varies.
3328"""
3329 conn = db_connect()
3330 row = conn.execute("SELECT username FROM profiles WHERE username=?", (username,)).fetchone()
3331 if not row:
3332 conn.execute("INSERT INTO profiles(username, updated_at) VALUES(?,?)", (username, now_z()))
3333 conn.commit()
3334 conn.close()
3335
3336
3337PROFILE_EXTRA_MAP = {
3338 "email": "email_enc",
3339 "phone": "phone_enc",
3340 "id_number": "id_number_enc",
3341 "tax_number": "tax_number_enc",
3342 "license_plate": "license_plate_enc",
3343 "car_model": "car_model_enc",
3344 "job": "job_enc",
3345 "town": "town_enc",
3346 "address": "address_enc",
3347 "family_members": "family_members_enc",
3348 "close_friends": "close_friends_enc",
3349 "height": "height_enc",
3350 "weight": "weight_enc",
3351 "hair_color": "hair_color_enc",
3352 "eye_color": "eye_color_enc",
3353 "city": "city_enc",
3354 "country": "country_enc",
3355 "state": "state_enc",
3356}
3357
3358
3359def get_profile(username: str) -> Dict[str, object]:
3360 """get_profile.
3361
3362Internal helper function.
3363
3364This docstring was added automatically to improve maintainability.
3365
3366Args:
3367 username: Parameter.
3368
3369Returns:
3370 Varies.
3371"""
3372 ensure_profile_row(username)
3373 conn = db_connect()

Callers 4

profile_saveFunction · 0.70
_complete_login_sessionFunction · 0.70
approval_promptFunction · 0.70
prompt_creator_accountFunction · 0.70

Calls 5

ensure_profile_rowFunction · 0.70
db_connectFunction · 0.70
aesgcm_encrypt_textFunction · 0.70
now_zFunction · 0.70

Tested by

no test coverage detected