From 19d3369df10fc4daca678399594e713fdf9b6e3d Mon Sep 17 00:00:00 2001 From: etj Date: Thu, 12 Oct 2023 18:27:55 +0200 Subject: [PATCH] Try some failing changes --- .github/workflows/flake8.yml | 8 ++++---- geonode/api/api.py | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 864b94d60bc..d3c16ace737 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -1,4 +1,4 @@ -name: "flake8" +name: "Code formatting" on: push: @@ -8,7 +8,7 @@ on: branches: [ "master", 4.0.x, 4.1.x ] jobs: - check_syntax: + validate: strategy: fail-fast: false @@ -29,12 +29,12 @@ jobs: - name: Install flake8 & black run: pip install flake8 black - - name: Check with flake8 + - name: "Check: flake8" run: | # stop the build if there are Python syntax errors or undefined names flake8 geonode --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 geonode --count --statistics - - name: Check formatting + - name: "Check: black" run: black --check geonode diff --git a/geonode/api/api.py b/geonode/api/api.py index c80c699ed48..f71b786bf54 100644 --- a/geonode/api/api.py +++ b/geonode/api/api.py @@ -19,6 +19,7 @@ import json import time +import os from django.apps import apps from django.db.models import Q @@ -70,11 +71,13 @@ class CountJSONSerializer(Serializer): + """Custom serializer to post process the api and add counts""" def get_resources_counts(self, options): if settings.SKIP_PERMS_FILTER: - resources = ResourceBase.objects.all() + resources = + ResourceBase.objects.all() else: resources = get_objects_for_user(options["user"], "base.view_resourcebase")