Skip to content

Commit

Permalink
today_rebate email function update
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Oct 10, 2023
1 parent 86db307 commit 7401fbc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions home/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,21 +610,18 @@ class about_Admin(ImportExportModelAdmin, admin.ModelAdmin):

@admin.action(description="Send mail to the caterer")
def send_mail(self, request, queryset):
from datetime import date
today = date.today()
text = "<li> {name} with {allocation_id} has applied from {start_date} to {end_date}</li>"
for caterer in Caterer.objects.all():
print(caterer.name)
message_caterer = ""
date = today
for obj in queryset:
print(obj.Caterer)
if(obj.Caterer != caterer.name): continue
allocation=obj.allocation_id
message_caterer +=(text.format(allocation_id=allocation.student_id,name=allocation.email.name, start_date=obj.start_date, end_date=obj.end_date))
obj.delete()
print(message_caterer)
if(message_caterer): caterer_mail(message_caterer, caterer.name,caterer.email, date)
if(message_caterer): caterer_mail(message_caterer, caterer.name,caterer.email, obj.date)


rebate_fields={"fields": (
Expand Down

0 comments on commit 7401fbc

Please sign in to comment.