Skip to content

Commit

Permalink
Fix: #64 Order data disclosure agreement and data sources in descendi…
Browse files Browse the repository at this point in the history
…ng order in service endpoints
  • Loading branch information
albinpa authored and georgepadayatti committed Apr 8, 2024
1 parent f5ad6a6 commit 7f69d55
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions config/migrations/0006_datasource_createdat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.0.7 on 2024-04-08 04:06

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('config', '0005_auto_20240405_0607'),
]

operations = [
migrations.AddField(
model_name='datasource',
name='createdAt',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DataSource(models.Model):
logoId = models.UUIDField(default=None, null=True, blank=True)
admin = models.OneToOneField(DataspaceUser, on_delete=models.CASCADE)
openApiUrl = models.CharField(max_length=255,null=True, blank=True)
createdAt = models.DateTimeField(auto_now_add=True)

def __str__(self):
return self.name
Expand Down
2 changes: 1 addition & 1 deletion service/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get(self, request):
if dataSourceId_param:
data_sources = DataSource.objects.filter(pk=dataSourceId_param)
else:
data_sources = DataSource.objects.all()
data_sources = DataSource.objects.all().order_by("-createdAt")

data_sources, pagination_data = paginate_queryset(data_sources, request)
serialized_data_sources = []
Expand Down

0 comments on commit 7f69d55

Please sign in to comment.