mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-10-09 09:51:36 +00:00
feat(devices): enhance device naming to include user details and enforce name length limit ✨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m1s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m1s
This commit is contained in:
@@ -183,6 +183,7 @@ class VerifyPaymentView(StaffEditorPermissionMixin, generics.UpdateAPIView):
|
||||
devices = payment.devices.all()
|
||||
data = request.data
|
||||
user = request.user
|
||||
user_details = f"{user.first_name.capitalize() if user.first_name else ''} {user.last_name.capitalize() if user.last_name else ''} {user.mobile}" # type: ignore
|
||||
omada_client = Omada()
|
||||
if payment.paid:
|
||||
return Response(
|
||||
@@ -218,7 +219,7 @@ class VerifyPaymentView(StaffEditorPermissionMixin, generics.UpdateAPIView):
|
||||
device_list.append(
|
||||
{
|
||||
"mac": device.mac,
|
||||
"name": device.name,
|
||||
"name": f"{user_details} - {device.name}",
|
||||
}
|
||||
)
|
||||
if device.registered:
|
||||
@@ -261,7 +262,7 @@ class VerifyPaymentView(StaffEditorPermissionMixin, generics.UpdateAPIView):
|
||||
device_list.append(
|
||||
{
|
||||
"mac": device.mac,
|
||||
"name": device.name,
|
||||
"name": f"{user_details} - {device.name}",
|
||||
}
|
||||
)
|
||||
if device.registered:
|
||||
|
Reference in New Issue
Block a user