Skip to content

Commit

Permalink
fix for DRF API access
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-bsi committed Dec 6, 2024
1 parent 960cc37 commit 293eb7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend/apps/ifc_validation/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from apps.ifc_validation_models.models import ValidationOutcome


class BaseSerializer(serializers.HyperlinkedModelSerializer):
class BaseSerializer(serializers.ModelSerializer):

def get_field_names(self, declared_fields, info):

Expand All @@ -28,7 +28,8 @@ class Meta:
model = ValidationRequest
fields = '__all__'
show = ["public_id", "model_public_id"]
hide = ["id", "model"]
hide = ["id"]
read_only_fields = ['size', 'created_by']


class ValidationTaskSerializer(BaseSerializer):
Expand Down
6 changes: 5 additions & 1 deletion backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
]
'rest_framework.authentication.TokenAuthentication',
],
'DEFAULT_PERMISSION_CLASSES':(
'rest_framework.permissions.IsAuthenticated',
),
}

SPECTACULAR_SETTINGS = {
Expand Down

0 comments on commit 293eb7a

Please sign in to comment.