Skip to content

Commit

Permalink
NEw CHanges
Browse files Browse the repository at this point in the history
  • Loading branch information
agent87 committed Feb 10, 2022
1 parent f2c1d75 commit f922bae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion DashboardApp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def update(self):
ticket.payment_method = self.cleaned_data['method']
ticket.parked = False
ticket.save()
print("----------------done---------------")
return ticket

class SubscriptionForm(forms.ModelForm):
Expand Down
2 changes: 0 additions & 2 deletions DashboardApp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def get(self, request):
ticket_json['fields']['cost'], ticket_json['alerts'] = models.Tarrif.match_tarrif(request.user.customer_id.customer_id, time.time(), ticket_json['fields']['checkin_time'])
ticket_json['fields']['checkin_time'] = datetime.utcfromtimestamp(ticket_obj.first().checkin_time + 7400).strftime('%H:%M')
ticket_json['fields']['checkin_date'] = datetime.utcfromtimestamp(ticket_obj.first().checkin_time).strftime('%Y-%m-%d')
print(ticket_json['fields']['checkin_time'])
return JsonResponse(ticket_json, safe=False)
else:
return JsonResponse({'error': 'No such ticket exists'})
Expand Down Expand Up @@ -185,7 +184,6 @@ def post(self, request):

elif request.POST.get('action') == 'update':
form = forms.TicketForm.CheckoutForm(request.POST)
print(form.errors)
if form.is_valid():
form.cleaned_data['user'] = request.user
form.update()
Expand Down
7 changes: 3 additions & 4 deletions SystemApp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def match_tarrif(self, customer_id, end_time:int,start_time: int):
except AttributeError:
return 0, [{'message': 'No tarrif found for this duration.', 'type':'error'},]


@classmethod
def remove_tarrif(self, tarrifid):
self.objects.filter(tarrifid=tarrifid).delete()
Expand Down Expand Up @@ -486,7 +486,6 @@ def format_checkin_datetime(self):

@property
def checkin_datetime(self):
print(datetime.datetime.fromtimestamp(self.checkin_time).strftime("%m/%d/%Y %H:%M"))
return datetime.datetime.fromtimestamp(self.checkin_time).strftime("%m/%d/%Y %H:%M")

@property
Expand Down Expand Up @@ -529,8 +528,8 @@ def delete_customer(customer_id):
def view_customer_users(customer_id):
users = Users.objects.filter(customer_id=customer_id)
for user in users:
print(user.email)
pass

def view_customers():
for customer in Customers.objects.all():
print(customer.customer_id, customer.company_name)
pass

0 comments on commit f922bae

Please sign in to comment.