Skip to content

Commit

Permalink
#99 delete unused arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4kE committed Dec 17, 2016
1 parent 8a6c156 commit 17b6261
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions core/views/checklist_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@method_decorator(login_required, name='dispatch')
class GetChecklistItemsView(JSONResponseMixin, View):
def get(self, request, *args, **kwargs):
def get(self, request):
checklist_items = ChecklistItem.objects.filter(checklist__user=request.user)

checklist_items_json = [_get_checklist_item_in_json(item) for item in checklist_items]
Expand All @@ -18,7 +18,7 @@ def get(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class GetChecklistItemsForTodayView(JSONResponseMixin, View):
def get(self, request, *args, **kwargs):
def get(self, request):
current_matchday = Matchday.get_current()
home_match_tomorrow = Match.objects.filter(
user=request.user,
Expand Down Expand Up @@ -68,7 +68,7 @@ def get(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class CreateChecklistItemView(JSONResponseMixin, View):
def get(self, request, *args, **kwargs):
def get(self, request):
checklist, _ = Checklist.objects.get_or_create(user=request.user)
new_checklist_item = ChecklistItem.objects.create(checklist=checklist, name='Neuer Eintrag')

Expand All @@ -79,7 +79,7 @@ def get(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class UpdateChecklistPriorityView(JSONResponseMixin, View):
def post(self, request, *args, **kwargs):
def post(self, request):
checklist_priority = request.POST.get('checklist_priority')

priority = [int(x) for x in checklist_priority.split(',')]
Expand All @@ -93,7 +93,7 @@ def post(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class UpdateChecklistItemNameView(JSONResponseMixin, View):
def post(self, request, *args, **kwargs):
def post(self, request):
checklist_item_id = request.POST.get('checklist_item_id')
checklist_item_name = request.POST.get('checklist_item_name')

Expand All @@ -109,7 +109,7 @@ def post(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class UpdateChecklistItemStatusView(JSONResponseMixin, View):
def post(self, request, *args, **kwargs):
def post(self, request):
checklist_item_id = request.POST.get('checklist_item_id')
checklist_item_checked = request.POST.get('checklist_item_checked')

Expand All @@ -128,7 +128,7 @@ def post(self, request, *args, **kwargs):

@method_decorator(login_required, name='dispatch')
class UpdateChecklistItemConditionView(JSONResponseMixin, View):
def post(self, request, *args, **kwargs):
def post(self, request):
checklist_item_id = request.POST.get('checklist_item_id')
checklist_item_matchdays = request.POST.get('checklist_item_matchdays')
checklist_item_matchday_pattern = request.POST.get('checklist_item_matchday_pattern')
Expand All @@ -144,8 +144,11 @@ def post(self, request, *args, **kwargs):

return self.render_json_response({'success': False})

def _handle_checklist_item_update(self, checklist_item, checklist_item_everyday,
checklist_item_home_match, checklist_item_matchday_pattern,
def _handle_checklist_item_update(self,
checklist_item,
checklist_item_everyday,
checklist_item_home_match,
checklist_item_matchday_pattern,
checklist_item_matchdays):
if checklist_item_matchdays:
self._update_checklist_item_condition(checklist_item, checklist_item_matchdays, None, False)
Expand All @@ -167,7 +170,7 @@ def _update_checklist_item_condition(checklist_item, checklist_item_matchdays, c

@method_decorator(login_required, name='dispatch')
class DeleteChecklistItemView(JSONResponseMixin, View):
def post(self, request, *args, **kwargs):
def post(self, request):
checklist_item_id = request.POST.get('checklist_item_id')
checklist_item = ChecklistItem.objects.get(checklist__user=request.user, id=checklist_item_id)
if checklist_item:
Expand Down

0 comments on commit 17b6261

Please sign in to comment.