Skip to content

Commit

Permalink
style: add noqa to all current line length violations
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas777 committed Oct 23, 2024
1 parent 723ea8f commit 3b487c9
Show file tree
Hide file tree
Showing 48 changed files with 616 additions and 616 deletions.
2 changes: 1 addition & 1 deletion audit_log/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _get_target(request):

def commit_to_audit_log(request, response):
current_time = timezone.now()
iso_8601_datetime = f"{current_time.replace(tzinfo=None).isoformat(sep='T', timespec='milliseconds')}Z"
iso_8601_datetime = f"{current_time.replace(tzinfo=None).isoformat(sep='T', timespec='milliseconds')}Z" # noqa: E501

message = {
"audit_event": {
Expand Down
6 changes: 3 additions & 3 deletions events/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def get_form(self, request, obj=None, **kwargs):

form.base_fields["maximum_attendee_capacity"].help_text = _(
"If the attendee capacity for the event is not restricted, please give a "
"rough estimate of at least the maximum attendee capacity. The information will be "
"used for statistical purposes. Maximum attendee capacity is a measure in the city "
"strategy that monitors the volumes of events held in the city. The estimate may be "
"rough estimate of at least the maximum attendee capacity. The information will be " # noqa: E501
"used for statistical purposes. Maximum attendee capacity is a measure in the city " # noqa: E501
"strategy that monitors the volumes of events held in the city. The estimate may be " # noqa: E501
"changed later if it is uncertain at the moment."
)

Expand Down
236 changes: 118 additions & 118 deletions events/api.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions events/api_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CustomPagination(pagination.PageNumberPagination):

page_size_query_param = "page_size"
page_size_query_description = _(
"Number of results to return per page. %(max_page_size)s is the maximum value for page_size."
"Number of results to return per page. %(max_page_size)s is the maximum value for page_size." # noqa: E501
) % {"max_page_size": max_page_size}

def get_paginated_response(self, data):
Expand Down Expand Up @@ -65,5 +65,5 @@ class LargeResultsSetPagination(CustomPagination):

page_size = 1000
page_size_query_description = _(
"Number of results to return per page. %(max_page_size)s is the maximum value for page_size."
"Number of results to return per page. %(max_page_size)s is the maximum value for page_size." # noqa: E501
) % {"max_page_size": max_page_size}
4 changes: 2 additions & 2 deletions events/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EventExtension(object):
#: The identifier for the extension (as referred to in the `extensions` argument)
identifier = None

#: The `related_name` for this extension's Event extension model. This will be added to
#: The `related_name` for this extension's Event extension model. This will be added to # noqa: E501
#: `select_related` queries done over the API.
related_name = None

Expand Down Expand Up @@ -42,7 +42,7 @@ def get_extension_serializer(self):
:return: The serializer.
:rtype: rest_framework.serializers.Serializer
"""
""" # noqa: E501

def post_create_event(self, request, event, data): # pragma: no cover
"""
Expand Down
22 changes: 11 additions & 11 deletions events/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _in_or_null_filter(field_name, queryset, name, value):
"""
Supports filtering objects by several values in the same field; null or none will trigger
isnull filter.
"""
""" # noqa: E501
q = Q()

if "null" in value or "none" in value:
Expand Down Expand Up @@ -116,7 +116,7 @@ def filter_division(queryset, name: str, value: Iterable[str]):
/event/?division=kunta:helsinki
will match the Helsinki municipality, if correct country information is present in settings.
"""
""" # noqa: E501

ocd_ids = []
names = []
Expand Down Expand Up @@ -186,7 +186,7 @@ class EventFilter(django_filters.rest_framework.FilterSet):
method=filter_division,
help_text=_(
"You may filter events by specific OCD division id, or by division name. "
"The latter query checks all divisions with the name, regardless of division type."
"The latter query checks all divisions with the name, regardless of division type." # noqa: E501
),
)
super_event_type = django_filters.Filter(
Expand All @@ -203,7 +203,7 @@ class EventFilter(django_filters.rest_framework.FilterSet):
widget=django_filters.widgets.CSVWidget(),
method=partial(_in_or_null_filter, "super_event"),
help_text=_(
"Search for events with the given superevent as specified by id, including none. "
"Search for events with the given superevent as specified by id, including none. " # noqa: E501
"Multiple ids are separated by comma."
),
)
Expand All @@ -214,38 +214,38 @@ class EventFilter(django_filters.rest_framework.FilterSet):
field_name="maximum_attendee_capacity",
lookup_expr="gte",
help_text=_(
"Search for events with maximum attendee capacity greater than or equal the "
"Search for events with maximum attendee capacity greater than or equal the " # noqa: E501
"applied parameter."
),
)
minimum_attendee_capacity_gte = django_filters.NumberFilter(
field_name="minimum_attendee_capacity",
lookup_expr="gte",
help_text=_(
"Search for events with minimum attendee capacity greater than or equal the "
"Search for events with minimum attendee capacity greater than or equal the " # noqa: E501
"applied parameter."
),
)
maximum_attendee_capacity_lte = django_filters.NumberFilter(
field_name="maximum_attendee_capacity",
lookup_expr="lte",
help_text=_(
"Search for events events with maximum attendee capacity less than or equal the "
"Search for events events with maximum attendee capacity less than or equal the " # noqa: E501
"applied parameter."
),
)
minimum_attendee_capacity_lte = django_filters.NumberFilter(
field_name="minimum_attendee_capacity",
lookup_expr="lte",
help_text=_(
"Search for events events with minimum attendee capacity less than or equal the "
"Search for events events with minimum attendee capacity less than or equal the " # noqa: E501
"applied parameter."
),
)
hide_recurring_children = django_filters.BooleanFilter(
method="filter_hide_recurring_children",
help_text=_(
"Hide all child events for super events which are of type <code>recurring</code>."
"Hide all child events for super events which are of type <code>recurring</code>." # noqa: E501
),
)

Expand Down Expand Up @@ -378,7 +378,7 @@ class OrganizationFilter(django_filters.rest_framework.FilterSet):
dissolved = django_filters.BooleanFilter(
method="filter_dissolved",
help_text=_(
"Get or exclude dissolved organizations; <code>true</code> shows only dissolved and "
"Get or exclude dissolved organizations; <code>true</code> shows only dissolved and " # noqa: E501
"<code>false</code> excludes dissolved organizations."
),
)
Expand Down Expand Up @@ -406,7 +406,7 @@ class PlaceFilter(django_filters.rest_framework.FilterSet):
method="filter_divisions",
help_text=_(
"You may filter places by specific OCD division id, or by division name. "
"The latter query checks all divisions with the name, regardless of division type."
"The latter query checks all divisions with the name, regardless of division type." # noqa: E501
),
)

Expand Down
4 changes: 2 additions & 2 deletions events/importer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def list_external_links(external_links):
for link in new_links:
if len(link.url) > 200:
logger.error(
f"{obj} required external link of length {len(link.url)}, current limit 200"
f"{obj} required external link of length {len(link.url)}, current limit 200" # noqa: E501
)
continue
new_link_objects.append(
Expand Down Expand Up @@ -567,7 +567,7 @@ def list_external_links(external_links):
self._set_field(obj, "event_status", status)

if obj._changed or obj._created:
# Finally, we must save the whole object, even when only related fields changed.
# Finally, we must save the whole object, even when only related fields changed. # noqa: E501
# Also, we want to log all that happened.
try:
obj.save()
Expand Down
Loading

0 comments on commit 3b487c9

Please sign in to comment.