Skip to content

Commit

Permalink
fix(userinfo): adds user info in prediction that lets user know about…
Browse files Browse the repository at this point in the history
… the user
  • Loading branch information
kshitijrajsharma committed Sep 26, 2024
1 parent 3d628d1 commit d8f9bdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@ class ApprovedPredictions(models.Model):
srid=4326
) ## Making this geometry field to support point/line prediction later on
approved_at = models.DateTimeField(auto_now_add=True)
approved_by = models.ForeignKey(
OsmUser, to_field="osm_id", on_delete=models.CASCADE
)
1 change: 1 addition & 0 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class ApprovedPredictionsViewSet(viewsets.ModelViewSet):
def create(self, request, *args, **kwargs):
training_id = request.data.get("training")
geom = request.data.get("geom")
request.data["approved_by"] = self.request.user

existing_approved_feature = ApprovedPredictions.objects.filter(
training=training_id, geom=geom
Expand Down

0 comments on commit d8f9bdf

Please sign in to comment.