MCPcopy Index your code
hub / github.com/tiny-pilot/tinypilot / change_role

Method change_role

app/db/users.py:49–57  ·  view source on GitHub ↗
(self, username, new_role, credentials_change_time)

Source from the content-addressed store, hash-verified

47 raise UserDoesNotExistError(f'User does not exist: {username}')
48
49 def change_role(self, username, new_role, credentials_change_time):
50 cursor = self._db_connection.execute(
51 'UPDATE users'
52 ' SET auth_role = ?, credentials_last_changed = ?'
53 ' WHERE username = ?',
54 [new_role.name,
55 _to_iso_string(credentials_change_time), username])
56 if cursor.rowcount == 0:
57 raise UserDoesNotExistError(f'User does not exist: {username}')
58
59 def delete(self, username):
60 cursor = self._db_connection.execute(

Calls 2

_to_iso_stringFunction · 0.85