Skip to content

Commit

Permalink
Merge pull request #39 from TRISHANT131104/main
Browse files Browse the repository at this point in the history
fixed TodayRebate function and rebate email error
  • Loading branch information
mittal-ishaan authored Oct 7, 2023
2 parents 7d88d3e + eee6e23 commit 8fcec91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions home/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def allocate(self, request, queryset):
@admin.register(TodayRebate)
class about_Admin(ImportExportModelAdmin, admin.ModelAdmin):
model = TodayRebate
search_fields = ("Caterer","allocation_id__roll_no__email")
search_fields = ("Caterer","allocation_id","date")
list_display =("allocation_id", "date","start_date","end_date")
# list_filter = ()
fieldsets = (
Expand Down Expand Up @@ -620,18 +620,18 @@ def send_mail(self, request, queryset):
for obj in queryset:
allocation=obj.allocation_id
if(obj.Caterer == "Kanaka"):
messageKanaka +=(text.format(allocation_id=allocation.student_id,name=allocation.roll_no.name, start_date=obj.start_date, end_date=obj.end_date))
messageKanaka +=(text.format(allocation_id=allocation.student_id,name=allocation.email.name, start_date=obj.start_date, end_date=obj.end_date))
elif(obj.Caterer == "Gauri"):
messageGauri +=(text.format(allocation_id=allocation.student_id,name=allocation.roll_no.name, start_date=obj.start_date, end_date=obj.end_date))
messageGauri +=(text.format(allocation_id=allocation.student_id,name=allocation.email.name, start_date=obj.start_date, end_date=obj.end_date))
elif(obj.Caterer == "Ajay"):
messageAjay +=(text.format(allocation_id=allocation.student_id,name=allocation.roll_no.name, start_date=obj.start_date, end_date=obj.end_date))
messageAjay +=(text.format(allocation_id=allocation.student_id,name=allocation.email.name, start_date=obj.start_date, end_date=obj.end_date))
obj.delete()
print(messageKanaka)
print(messageGauri)
print(messageAjay)
if(messageAjay): caterer_mail(messageAjay, "Ajay","me210003039@iiti.ac.in", date)
if(messageKanaka): caterer_mail(messageKanaka, "Kanaka","me210003039@iiti.ac.in",date)
if(messageGauri): caterer_mail(messageGauri, "Gauri","me210003039@iiti.ac.in",date)
if(messageAjay): caterer_mail(messageAjay, "Ajay","mems220005054@iiti.ac.in", date)
if(messageKanaka): caterer_mail(messageKanaka, "Kanaka","mems220005054@iiti.ac.in",date)
if(messageGauri): caterer_mail(messageGauri, "Gauri","mems220005054@iiti.ac.in",date)


rebate_fields={"fields": (
Expand Down
2 changes: 1 addition & 1 deletion messWebsite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@
EMAIL_PORT = 587
EMAIL_USE_SSL = False
EMAIL_HOST_USER = env('EMAIL_HOST')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD')

0 comments on commit 8fcec91

Please sign in to comment.