Skip to content

Commit

Permalink
fix: Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Nov 7, 2024
1 parent 2545952 commit 85e0415
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion uvdat/core/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def followers(self):

@transaction.atomic()
def delete_users_perms(self, users: list[User]):
"""Deletes all permissions a user may have on this project."""
"""Delete all permissions a user may have on this project."""
user_ids = [user.id for user in users]
UserObjectPermission.objects.filter(
content_type__app_label=self._meta.app_label,
Expand Down
1 change: 0 additions & 1 deletion uvdat/core/rest/serializers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.contrib.auth.models import User
from django.contrib.gis.geos import Point
from django.contrib.gis.serializers import geojson
from guardian.shortcuts import get_users_with_perms
from rest_framework import serializers

from uvdat.core.models import (
Expand Down
2 changes: 1 addition & 1 deletion uvdat/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from uvdat.core.models import Project

from .factory_fixtures import * # noqa: F403
from .factory_fixtures import * # noqa: F403, F401


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion uvdat/core/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class FuzzyPointField(factory.fuzzy.BaseFuzzyAttribute):
"""Yields random point"""
"""Yield random point."""

def __init__(self, **kwargs):
super().__init__(**kwargs)
Expand Down
8 changes: 5 additions & 3 deletions uvdat/core/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from uvdat.core.models.networks import Network, NetworkEdge, NetworkNode
from uvdat.core.models.networks import Network, NetworkNode
from uvdat.core.models.project import Dataset, Project


Expand Down Expand Up @@ -81,7 +81,8 @@ def test_rest_dataset_gcc(
dataset = network.dataset
project.datasets.add(dataset)
resp = authenticated_api_client.get(
f'/api/v1/datasets/{dataset.id}/gcc/?project={project.id}&exclude_nodes={connecting_node.id}'
f'/api/v1/datasets/{dataset.id}/gcc/'
f'?project={project.id}&exclude_nodes={connecting_node.id}'
)

larger_group: list[NetworkNode] = max(group_a, group_b, key=len)
Expand Down Expand Up @@ -109,7 +110,8 @@ def test_rest_dataset_map_layers_incorrect_layer_type(
for _ in range(3):
factory(dataset=dataset)

# Check that nothing is returned, since map_layers will only return map layers that match the dataset's type
# Check that nothing is returned, since map_layers will only
# return map layers that match the dataset's type
resp = authenticated_api_client.get(f'/api/v1/datasets/{dataset.id}/map_layers/')
assert resp.status_code == 200
assert resp.json() == []
Expand Down

0 comments on commit 85e0415

Please sign in to comment.