Split a nickname into first/last. Ensures last is non-empty.
(nick: str, fallback_last: str)
| 15216 | """ |
| 15217 | conn = db_connect() |
| 15218 | row = conn.execute("SELECT role FROM group_members WHERE group_id=? AND username=?", (gid, username)).fetchone() |
| 15219 | conn.close() |
| 15220 | return row["role"] if row else None |
| 15221 | |
| 15222 | @app.route("/groups") |
| 15223 | @login_required |
| 15224 | def groups(): |
| 15225 | """List groups for the current user (with auto-heal schema).""" |
| 15226 | me = current_user() |
| 15227 | # Ensure group tables exist even on upgraded databases |
| 15228 | try: |
| 15229 | db_init() |
| 15230 | except Exception: |
| 15231 | pass |
| 15232 | |
| 15233 | def _fetch_rows(): |
no outgoing calls
no test coverage detected