1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

ignore new ixf field (#1082)

* ignore new ixf field

* pre-commit

* gh actions linting fix
This commit is contained in:
Matt Griswold
2021-10-30 10:20:04 -05:00
committed by GitHub
parent 3b78cd6270
commit 1eda45ffeb
23 changed files with 36 additions and 48 deletions

View File

@@ -9,33 +9,24 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: ${{ runner.os }}-pip
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1.1.1
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# virtualenvs-path: ~/.venv
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s poetry run pip --version || rm -rf .venv
# install dependencies if cache does not exist
- name: Check cache and install dependencies
run: poetry install
run: poetry install --no-interaction --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Run linters
run: |
source .venv/bin/activate

View File

@@ -118,4 +118,3 @@ Command line whois.
## pdb_wipe.py
Wipe all peering data.

View File

@@ -280,4 +280,3 @@ View definitions:
- Entity views (network, facility, internet exchange and organization)
- Sponsorships
- User Registration

View File

@@ -288,4 +288,3 @@ ToolHistory(peeringdb_server.autocomplete_views.CommandLineToolHistoryAutocomple
```
Autocomplete for command line tools that were run via the admin ui.

View File

@@ -27,4 +27,3 @@ TestRouter(peeringdb_server.db_router.DatabaseRouter)
A very basic database router that routes to a different
read and write db.

View File

@@ -58,4 +58,3 @@ MungeRenderer(rest_framework.renderers.BaseRenderer)
All renderers should extend this class, setting the `media_type`
and `format` attributes, and override the `.render()` method.

View File

@@ -177,5 +177,3 @@ In instances where you want to check permissions after the data has been seriali
```
PeeringDB uses [django-grainy](https://github.com/20c/django-grainy) for granular permission checking and handling.

View File

@@ -56,7 +56,7 @@ class Backend(BaseBackend):
return self.CONCRETE_MAP.get(cls)
@reftag_to_cls
def get_fields(self, concrete):
def get_fields(self, concrete, ignore_fields=None):
"""
Sync currently doesnt support OneToOne relationships
and none of the ones that exist in peeringdb_server
@@ -66,12 +66,16 @@ class Backend(BaseBackend):
Here we make sure to not process OneToOneRel relationships
"""
if not ignore_fields:
ignore_fields = ["ixf_import_request_user"]
_fields = super().get_fields(concrete)
fields = []
for field in _fields:
if isinstance(field, OneToOneRel):
continue
if field.name in ignore_fields:
continue
fields.append(field)
return fields