Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/trustride/llms.txt

Use this file to discover all available pages before exploring further.

Every driver on TrustRide must be manually verified by a platform administrator before they can publish trips. The admin panel provides a complete user management interface: browsing all accounts, filtering by role or status, reviewing pending verification queues, approving or revoking driver verification, and suspending or reinstating accounts.

Browsing Users

GET /control/users/ lists all registered users across every role. The list is ordered by date_joined descending (newest first) and paginates at 25 users per page. Two filtered shortcut paths are also available:
  • GET /control/users/riders/ — shows only users with role = "rider"
  • GET /control/users/drivers/ — shows only users with role = "driver"
All three paths share the same user_list view and support the following query parameters:
ParameterEffect
qFull-text search across first name, last name, email, and phone
roleFilter by rider or driver
status=suspendedShow only users where is_suspended = True
status=activeShow only non-suspended, active accounts
status=unverifiedShow only drivers where is_driver_verified = False

Pending Verifications Queue

GET /control/users/pending/ is the primary driver verification queue. It displays all driver accounts that meet all three of these conditions:
  • role = "driver"
  • is_driver_verified = False
  • is_suspended = False
Results are ordered by date_joined (oldest first) so the longest-waiting drivers appear at the top. The page header shows the total count of drivers awaiting review.
This is the recommended starting point for daily verification work. Check this queue each morning to ensure drivers are not left waiting longer than necessary to publish their first trip.

User Detail Page

GET /control/users/<id>/ shows the full profile for any user. The detail page includes:
  • All personal fields from the User model (name, email, phone, gender, role, flags)
  • The user’s 10 most recent bookings (as rider or as driver on the trip)
  • The driver’s 10 most recent trips (only shown when role = "driver")
  • The user’s 10 most recent refund requests (as rider or as driver)
This is the primary context screen before taking any action on a user account.

Verifying a Driver

POST /control/users/<id>/verify-driver/ Sets is_driver_verified = True on the user record. The view confirms the field was saved successfully (using refresh_from_db()) and logs the outcome. After verification the driver can publish trips and appear in search results.
POST /control/users/42/verify-driver/
The view validates that the target user has role = "driver" before making any change. If the user is not a driver, an error message is shown and the admin is redirected back to the pending verifications queue.
Do not verify a driver without reviewing their documents first. Verifying a driver without checking their licence, vehicle registration, and plate number grants them immediate permission to publish trips and collect payments from riders. A false verification cannot be undone automatically — you must manually revoke it and notify the driver.
When a driver is verified, TrustRide logs the action to the audit log under the verify_driver action type. No automated email notification is sent to the driver from this view — notify the driver manually via the admin WhatsApp or email configured in platform settings.

What to Check Before Verifying

Before clicking verify, open the driver’s detail page and confirm the following:
1

Check the driver's licence

Open the uploaded government-issued driver’s licence image. Verify the name matches the account’s first_name and last_name. Check that the licence is not expired.
2

Check vehicle registration

Review the uploaded vehicle registration document. Confirm the vehicle make, model, and year match the driver’s registered vehicle in the system.
3

Validate the plate number

Cross-reference the plate number on the registration document against the plate_number field on the driver’s vehicle record. TrustRide enforces Nigerian plate number format via the validate_plate_number validator. If the format is wrong, ask the driver to correct it before verifying.
4

Confirm identity

Check that the profile photo (if uploaded) plausibly matches the licence photo. For higher-confidence verification, a second ID document (national ID or international passport) can be requested.
5

Approve or flag

If all documents are valid, click Verify Driver. If anything is unclear or missing, leave the driver unverified and use the admin WhatsApp or email to contact them for correction.

Revoking Driver Verification

POST /control/users/<id>/unverify-driver/ Sets is_driver_verified = False. The driver loses the ability to publish new trips. Any trips already published remain in the system but should be reviewed individually. This action is logged to the audit log under unverify_driver.
POST /control/users/42/unverify-driver/

Suspending a User

POST /control/users/<id>/suspend/ Suspension sets both is_suspended = True and is_active = False, which prevents the user from logging in. The endpoint rejects attempts to suspend any account with is_staff = True or is_superuser = True. The reason POST parameter is saved to the audit log. Cascading effects of suspending a driver: When a driver is suspended, the platform automatically:
  1. Cancels all their draft and published trips (sets status = "cancelled", is_active = False).
  2. Sends a system chat message to every rider with an active booking on those trips, advising them to contact support for a refund.
Cascading effects of suspending a rider: When a rider is suspended, the platform automatically:
  1. Cancels all their reserved and pending_verification bookings.
  2. Returns one available seat to the trip for each cancelled booking.
POST /control/users/99/suspend/
Content-Type: application/x-www-form-urlencoded

reason=Fraudulent+payment+attempt+detected
Suspending a driver is a high-impact action. It immediately cancels all their upcoming trips and disrupts every rider who had booked those trips. Always contact the driver and attempt resolution before suspending. Reserve immediate suspension for confirmed safety violations, fraud, or abuse.

Reinstating a User

POST /control/users/<id>/reinstate/ Sets is_suspended = False and is_active = True, restoring the user’s ability to log in. Previously cancelled trips are not automatically restored — drivers must re-publish trips manually after reinstatement. The action is logged to the audit log under reinstate_user.
POST /control/users/99/reinstate/

Changing a User’s Role

POST /control/users/<id>/change-role/ Changes the user’s role field. The only accepted values are "rider" and "driver". Any other value returns a 400 JSON error. The old and new role are both recorded in the audit log notes.
POST /control/users/42/change-role/
Content-Type: application/x-www-form-urlencoded

role=driver
Changing a user from rider to driver does not automatically set is_driver_verified = True. The driver must still go through the verification queue before publishing trips.

Audit Trail

Every verification action — verify, unverify, suspend, reinstate, change role — is written to the AuditLog table with the following fields:
FieldValue
adminThe staff user who performed the action
actionOne of verify_driver, unverify_driver, suspend_user, reinstate_user, change_role
target_type"user"
target_idThe user’s integer primary key
target_labelFull name and role string (e.g. "Aminu Garba (driver)")
notesReason text or role transition string
ip_addressThe admin’s IP address at time of action
You can review the full audit history at GET /control/audit/.

Build docs developers (and LLMs) love