Skip to content

Commit d30541e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7a279fc commit d30541e

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

sde_collections/views.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
User = get_user_model()
5353

54-
from django.db.models import BooleanField, Case, Value, When, Q
54+
from django.db.models import BooleanField, Case, Q, Value, When
5555

5656

5757
class CollectionListView(LoginRequiredMixin, ListView):
@@ -227,6 +227,7 @@ def get_context_data(self, **kwargs):
227227

228228
return context
229229

230+
230231
class AffectedURLsListView(LoginRequiredMixin, ListView):
231232
"""
232233
Display a list of URLs affected by a match pattern
@@ -238,21 +239,21 @@ class AffectedURLsListView(LoginRequiredMixin, ListView):
238239

239240
def get_queryset(self):
240241

241-
if 'exclude-pattern' in self.request.path:
242+
if "exclude-pattern" in self.request.path:
242243
self.pattern = ExcludePattern.objects.get(id=self.kwargs["id"])
243244
self.pattern_type = "Exclude"
244-
elif 'include-pattern' in self.request.path:
245+
elif "include-pattern" in self.request.path:
245246
self.pattern = IncludePattern.objects.get(id=self.kwargs["id"])
246247
self.pattern_type = "Include"
247-
elif 'title-pattern' in self.request.path:
248+
elif "title-pattern" in self.request.path:
248249
self.pattern = TitlePattern.objects.get(id=self.kwargs["id"])
249250
self.pattern_type = "Title"
250-
elif 'document-type-pattern' in self.request.path:
251+
elif "document-type-pattern" in self.request.path:
251252
self.pattern = DocumentTypePattern.objects.get(id=self.kwargs["id"])
252253
self.pattern_type = "Document Type"
253254
else:
254255
return super().get_queryset()
255-
256+
256257
queryset = self.pattern.matched_urls()
257258
return queryset
258259

@@ -265,6 +266,7 @@ def get_context_data(self, **kwargs):
265266

266267
return context
267268

269+
268270
class SdeDashboardView(LoginRequiredMixin, ListView):
269271
model = Collection
270272
template_name = "sde_collections/sde_dashboard.html"

sde_indexing_helper/static/css/affected_urls.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,4 +483,4 @@ body {
483483

484484
.cross-mark, .tick-mark {
485485
cursor: pointer; /* Show hand cursor */
486-
}
486+
}

sde_indexing_helper/static/js/affected_urls.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function handleIncludeIndividualUrlClick() {
7171
true
7272
);
7373

74-
74+
7575
} else {
7676
var url = $(this).attr("value");
7777
console.log("url", url);
@@ -83,7 +83,7 @@ function handleIncludeIndividualUrlClick() {
8383
currentURLtoDelete,
8484
(data_type = "Include Pattern")
8585
);
86-
86+
8787
// Change back to cross mark
8888
i.classList.remove('tick-mark');
8989
i.classList.add('cross-mark'); // Add the cross-mark class
@@ -105,7 +105,7 @@ function handleIncludeIndividualUrlClick() {
105105
}).catch(function(error) {
106106
console.error("Error occurred:", error);
107107
});
108-
108+
109109
}
110110

111111
});
@@ -137,7 +137,7 @@ function handleIncludeIndividualUrlClick() {
137137
true
138138
);
139139

140-
140+
141141
} else {
142142
// Handle the functionality of including that URL again (maybe delete that exclude pattern which was just created)
143143
var url = $(this).attr("value");
@@ -150,7 +150,7 @@ function handleIncludeIndividualUrlClick() {
150150
currentURLtoDelete,
151151
(data_type = "Exclude Pattern")
152152
);
153-
153+
154154
// Change back to cross mark
155155
i.classList.remove('tick-mark');
156156
i.classList.add('cross-mark'); // Add the cross-mark class
@@ -171,7 +171,7 @@ function handleIncludeIndividualUrlClick() {
171171
}).catch(function(error) {
172172
console.error("Error occurred:", error);
173173
});
174-
174+
175175
}
176176

177177
});
@@ -248,7 +248,7 @@ function deletePattern(
248248
error: function (xhr, status, error) {
249249
var errorMessage = xhr.responseText;
250250
toastr.error(errorMessage);
251-
},
251+
},
252252
});
253253
}
254254

@@ -290,4 +290,4 @@ function getCorrespondingExcludePattern(url) {
290290
console.error("Error fetching exclude patterns:", error);
291291
return null;
292292
});
293-
}
293+
}

sde_indexing_helper/templates/sde_collections/affected_urls.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ <h1 class="pageTitle">Affected URLs</h1>
2222
<div class="candidateUrlContainer">
2323

2424
<h3 class="whiteText candidateTitle">
25-
{{ url_count|intcomma }} affected URLs for {{ pattern_type | lower }} pattern:
25+
{{ url_count|intcomma }} affected URLs for {{ pattern_type | lower }} pattern:
2626
<span style="color: #65B1EF;">{{ pattern.match_pattern }}</span>
2727
</h3>
28-
28+
2929
<div class="container mt-4">
3030
<!-- Table to display the URLs -->
3131
<table id="affectedURLsTable" class="table" style="width:100%">
@@ -52,10 +52,10 @@ <h3 class="whiteText candidateTitle">
5252
<td class="text-center">{{ forloop.counter }}</td>
5353
<td>
5454
<div class="url-cell"><span class="candidate_url nameStyling">{{ url.url }}</span>
55-
<a target="_blank" href="{{ url.url }}" data-url="/api/candidate-urls/{{url.id}}/" class="url-link">
56-
<i class="material-icons url-icon">open_in_new</i></a>
55+
<a target="_blank" href="{{ url.url }}" data-url="/api/candidate-urls/{{url.id}}/" class="url-link">
56+
<i class="material-icons url-icon">open_in_new</i></a>
5757
</div>
58-
</td>
58+
</td>
5959
<!-- <td class="col-3 text-center data-sort="0">
6060
{% if pattern_type == "Exclude" %}
6161
<a class="include-url-btn" data-url-id="{{ url.id }}" value = "{{url.url}}">
@@ -97,4 +97,4 @@ <h3 class="whiteText candidateTitle">
9797
<script src="{% static 'js/affected_urls.js' %}"></script>
9898
<script src="{% static 'js/core/bootstrap.min.js' %}"></script>
9999

100-
{% endblock javascripts %}
100+
{% endblock javascripts %}

0 commit comments

Comments
 (0)