Skip to content

Commit

Permalink
final device = last employee created name
Browse files Browse the repository at this point in the history
  • Loading branch information
imanirak committed Apr 24, 2022
1 parent 1c5e6d6 commit 69084cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ def form_valid(self,form):
self.object.user = self.request.user
device_type = self.object.device_type
device = self.object

#update name based on last created employee
employee = Employee.objects.last()
device.name = employee
device_name = employee

device.name = device_name
device.save(['name'])


Expand Down

0 comments on commit 69084cc

Please sign in to comment.