Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot Fix : Patch on feedback labels overwrite #150

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions backend/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@


@admin.register(Dataset)
class DatasetAdmin(geoadmin.GeoModelAdmin):
class DatasetAdmin(geoadmin.OSMGeoAdmin):
list_display = ["name", "created_by"]


@admin.register(Model)
class ModelAdmin(geoadmin.GeoModelAdmin):
class ModelAdmin(geoadmin.OSMGeoAdmin):
list_display = ["get_dataset_id", "name", "status", "created_at", "created_by"]

def get_dataset_id(self, obj):
Expand All @@ -22,7 +22,7 @@ def get_dataset_id(self, obj):


@admin.register(Training)
class TrainingAdmin(geoadmin.GeoModelAdmin):
class TrainingAdmin(geoadmin.OSMGeoAdmin):
list_display = [
"get_model_id",
"description",
Expand All @@ -39,12 +39,11 @@ def get_model_id(self, obj):
get_model_id.short_description = "Model"


# dsaf
@admin.register(FeedbackAOI)
class FeedbackAOIAdmin(geoadmin.GeoModelAdmin):
class FeedbackAOIAdmin(geoadmin.OSMGeoAdmin):
list_display = ["training", "user"]


@admin.register(FeedbackLabel)
class FeedbackLabelAdmin(geoadmin.GeoModelAdmin):
list_display = ["feedback_aoi", "created_at"]
@admin.register(Feedback)
class FeedbackAdmin(geoadmin.OSMGeoAdmin):
list_display = ["feedback_type", "training", "user", "created_at"]
4 changes: 2 additions & 2 deletions backend/core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ class Meta:
# auto_bbox = True
fields = "__all__"

read_only_fields = ("created_at", "osm_id")
# read_only_fields = ("created_at", "osm_id")


class FeedbackLabelSerializer(GeoFeatureModelSerializer):
class Meta:
model = FeedbackLabel
geo_field = "geom"
fields = "__all__"
read_only_fields = ("created_at", "osm_id")
# read_only_fields = ("created_at", "osm_id")


class LabelFileSerializer(
Expand Down
4 changes: 2 additions & 2 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ class LabelViewSet(viewsets.ModelViewSet):


class RawdataApiFeedbackView(APIView):
authentication_classes = [OsmAuthentication]
permission_classes = [IsOsmAuthenticated]
# authentication_classes = [OsmAuthentication]
# permission_classes = [IsOsmAuthenticated]

def post(self, request, feedbackaoi_id, *args, **kwargs):
"""Downloads available osm data as labels within given feedback aoi
Expand Down