Commit 77cb9743 authored by Florent Chehab's avatar Florent Chehab

Fix bug in userdata not being automatically create in the backend

other fixes and linting
parent f66bb2b6
...@@ -8,16 +8,16 @@ build_frontend: ...@@ -8,16 +8,16 @@ build_frontend:
npm run build npm run build
test_backend: test_backend:
pytest general/ frontend/ backend/ cd backend && pytest base_app/ frontend_app/ backend_app/
test_backend_server: test_backend_server:
pytest -n 4 general/ frontend/ backend/ --cov-report html cd backend && pytest -n 4 base_app/ frontend_app/ backend_app/ --cov-report html
check_backend: check_backend:
./manage.py check cd backend && ./manage.py check
run_backend: run_backend:
./manage.py runserver cd backend && ./manage.py runserver
docs: docs:
......
...@@ -14,7 +14,7 @@ for model in api_config: ...@@ -14,7 +14,7 @@ for model in api_config:
if "model" in model and model['model']: if "model" in model and model['model']:
model = DotMap(model) model = DotMap(model)
if (not model.requires_testing) and (not model.ignore_in_admin): if (not model.requires_testing) and (not model.ignore_in_admin):
module = importlib.import_module("backend_app.models.{}".format (model.import_location)) module = importlib.import_module("backend_app.models.{}".format(model.import_location))
if model.versionned: if model.versionned:
VERSIONNED_MODELS.append(getattr(module, model.model)) VERSIONNED_MODELS.append(getattr(module, model.model))
else: else:
......
...@@ -12,7 +12,7 @@ for model in api_config: ...@@ -12,7 +12,7 @@ for model in api_config:
model = DotMap(model) model = DotMap(model)
if not model.requires_testing: if not model.requires_testing:
if model.viewset != 'UserDataViewSet': if model.viewset != 'UserDataViewSet':
module = importlib.import_module("backend_app.models.{}".format (model.import_location)) module = importlib.import_module("backend_app.models.{}".format(model.import_location))
ALL_VIEWSETS[model.viewset] = getattr(module, model.viewset) ALL_VIEWSETS[model.viewset] = getattr(module, model.viewset)
if settings.TESTING: if settings.TESTING:
...@@ -20,7 +20,7 @@ if settings.TESTING: ...@@ -20,7 +20,7 @@ if settings.TESTING:
model = DotMap(model) model = DotMap(model)
if model.requires_testing: if model.requires_testing:
if model.viewset != 'UserDataViewSet': if model.viewset != 'UserDataViewSet':
module = importlib.import_module("backend_app.models.{}".format (model.import_location)) module = importlib.import_module("backend_app.models.{}".format(model.import_location))
ALL_VIEWSETS[model.viewset] = getattr(module, model.viewset) ALL_VIEWSETS[model.viewset] = getattr(module, model.viewset)
......
...@@ -75,4 +75,4 @@ for Viewset in ALL_VIEWSETS: ...@@ -75,4 +75,4 @@ for Viewset in ALL_VIEWSETS:
for p in DEFAULT_VIEWSET_PERMISSIONS: for p in DEFAULT_VIEWSET_PERMISSIONS:
v_p = Viewset.permission_classes v_p = Viewset.permission_classes
if p not in v_p: if p not in v_p:
raise Exception("Permission_classes are not defined correctly in the viewset {}".format(str(viewset))) raise Exception("Permission_classes are not defined correctly in the viewset {}".format(str(Viewset)))
#OutGoing_REX #OutGoing_REX
Django==2.0.10 Django==2.0.10
#psycopg2-binary==2.7.4 psycopg2-binary==2.7.4
git+https://github.com/mingchen/django-cas-ng.git@e9c0472e326087bfb839487f0736a4e1454cffda#egg=django-cas-ng git+https://github.com/mingchen/django-cas-ng.git@e9c0472e326087bfb839487f0736a4e1454cffda#egg=django-cas-ng
djangorestframework==3.8.2 # Django REST Framework djangorestframework==3.8.2 # Django REST Framework
coreapi==2.3.3 # Automatic API doc generation coreapi==2.3.3 # Automatic API doc generation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment