Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Jul 3, 2023
1 parent 138fbf2 commit 1de0c9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ocw/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, template_name=None, **extra):
super().__init__(template_name="ocw/tags.html", orderable=False, **extra)

@property
def header(self, **kwargs):
def header(self):
return get_template('ocw/tags_header.html').render()


Expand Down Expand Up @@ -94,8 +94,8 @@ class BaseFilterSet(django_filters.FilterSet):
def __init__(self, data=None, *args, **kwargs):
if data is not None:
data = data.copy()
for name, f in self.base_filters.items():
initial = f.extra.get('initial')
for name, filter in self.base_filters.items():
initial = filter.extra.get('initial')

Check warning on line 98 in ocw/tables.py

View check run for this annotation

Codecov / codecov/patch

ocw/tables.py#L97-L98

Added lines #L97 - L98 were not covered by tests
if not data.get(name) and initial is not None:
if isinstance(initial, list):
data.setlistdefault(name, initial)
Expand Down
6 changes: 4 additions & 2 deletions ocw/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from .tables import InstanceTable
from .tables import InstanceFilter

# pylint: disable=unused-argument


class FilteredSingleTableView(SingleTableView):
filter_class = None
Expand Down Expand Up @@ -72,6 +74,6 @@ def update_status(request):

@login_required
def delete(request, key_id=None):
o = Instance.objects.get(id=key_id)
db.delete_instance(o)
obj = Instance.objects.get(id=key_id)
db.delete_instance(obj)

Check warning on line 78 in ocw/views.py

View check run for this annotation

Codecov / codecov/patch

ocw/views.py#L77-L78

Added lines #L77 - L78 were not covered by tests
return redirect('update')

0 comments on commit 1de0c9d

Please sign in to comment.