Skip to content

Commit

Permalink
Merge pull request #1525 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
refactor(task): change base template name
  • Loading branch information
Aashish Vinu authored Nov 5, 2023
2 parents e42d505 + e05cbab commit 2500b1c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/dashboard/karma_voucher/karma_voucher_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class VoucherBaseTemplateAPI(APIView):
authentication_classes = [CustomizePermission]

def get(self, request):
wb = load_workbook('./api/dashboard/karma_voucher/assets/base_template.xlsx')
wb = load_workbook('./api/dashboard/karma_voucher/assets/voucher_base_template.xlsx')
ws = wb['Data Definitions']
hashtags = TaskList.objects.all().values_list('hashtag', flat=True)
data = {
Expand All @@ -352,4 +352,4 @@ def get(self, request):
with open(tmp.name, 'rb') as f:
f.seek(0)
new_file_object = f.read()
return FileResponse(BytesIO(new_file_object), as_attachment=True, filename='base_template.xlsx')
return FileResponse(BytesIO(new_file_object), as_attachment=True, filename='voucher_base_template.xlsx')
4 changes: 2 additions & 2 deletions api/dashboard/task/dash_task_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class TaskBaseTemplateAPI(APIView):
authentication_classes = [CustomizePermission]

def get(self, request):
wb = load_workbook('./api/dashboard/task/assets/base_template.xlsx')
wb = load_workbook('./api/dashboard/task/assets/task_base_template.xlsx')
ws = wb['Data Definitions']
levels = Level.objects.all().values_list('name', flat=True)
channels = Channel.objects.all().values_list('name', flat=True)
Expand Down Expand Up @@ -536,4 +536,4 @@ def get(self, request):
with open(tmp.name, 'rb') as f:
f.seek(0)
new_file_object = f.read()
return FileResponse(BytesIO(new_file_object), as_attachment=True, filename='base_template.xlsx')
return FileResponse(BytesIO(new_file_object), as_attachment=True, filename='task_base_template.xlsx')
2 changes: 1 addition & 1 deletion api/dashboard/task/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

urlpatterns = [

path('channels/', dash_task_view.ChannelDropdownAPI.as_view()),
path('channel/', dash_task_view.ChannelDropdownAPI.as_view()),
path('ig/', dash_task_view.IGDropdownAPI.as_view()),
path('organization/', dash_task_view.OrganizationDropdownAPI.as_view()),
path('level/', dash_task_view.LevelDropdownAPI.as_view()),
Expand Down

0 comments on commit 2500b1c

Please sign in to comment.