Skip to content

Fix/endpoints#43

Closed
Ke-vin-S wants to merge 3 commits into
IASSCMS:mainfrom
Ke-vin-S:fix/endpoints
Closed

Fix/endpoints#43
Ke-vin-S wants to merge 3 commits into
IASSCMS:mainfrom
Ke-vin-S:fix/endpoints

Conversation

@Ke-vin-S
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 17, 2025 10:35
@Ke-vin-S Ke-vin-S closed this May 17, 2025
@Ke-vin-S Ke-vin-S deleted the fix/endpoints branch May 17, 2025 10:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes endpoints and updates field usage across the fleet module by renaming the vehicle “name” field to “model”, updating URL parameter names from pk to vehicle_id, and adding a new driver_assigned field.

  • Renames vehicle name to model (views, serializers, tests, model, admin)
  • Updates endpoint parameters to use vehicle_id instead of pk
  • Adds a driver_assigned field with accompanying filtering and tests

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
logistics_core/settings.py Adds dotenv support but duplicates BASE_DIR and leaves a debug print statement
fleet/views/vehicle.py Updates endpoints to use vehicle_id and applies serializer changes
fleet/views/trip.py & fleet/views/fuel.py Updates field reference from "name" to "model"
fleet/tests/test_vehicle_api.py & test_vehicle Updates tests to reflect field renaming and URL changes
fleet/serializers/vehicle.py Updates serializers for the new "model" field and introduces a location detail
fleet/serializers/init.py Adjusts serializer imports and re-exports
fleet/models/core.py, migrations Performs model field updates and adds driver_assigned field
fleet/admin.py Updates admin display to use "model" instead of "name"
entrypoint.sh Provides a fallback when running the Django server
Files not reviewed (1)
  • .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)

fleet/serializers/vehicle.py:51

  • VehicleLocation is used here without an explicit import; please add the necessary import statement for the VehicleLocation model.
history_qs = VehicleLocation.objects.filter(vehicle=obj).order_by('-timestamp')


BASE_DIR = Path(__file__).resolve().parent.parent
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Copy link

Copilot AI May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a duplicate assignment of BASE_DIR; please remove the redundant declaration to improve code clarity.

Suggested change
BASE_DIR = Path(__file__).resolve().parent.parent

Copilot uses AI. Check for mistakes.
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

print(os.getenv('ALLOWED_HOSTS'))
Copy link

Copilot AI May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A debug print statement is left in production code; consider removing it or wrapping it in a conditional based on the debug setting.

Suggested change
print(os.getenv('ALLOWED_HOSTS'))
if DEBUG:
print(os.getenv('ALLOWED_HOSTS'))

Copilot uses AI. Check for mistakes.
@Ke-vin-S Ke-vin-S restored the fix/endpoints branch May 17, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants