Skip to content

Commit

Permalink
bplan/serializer: fix sentry errors and a warning
Browse files Browse the repository at this point in the history
sentry: https://sentry.liqd.net/organizations/liqd/issues/1476/?project=24
https://sentry.liqd.net/organizations/liqd/issues/1477/?project=24

warning: `UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class bplan.models.BPlan> QuerySet.`
  • Loading branch information
fuzzylogic2000 authored and philli-m committed Jun 7, 2021
1 parent 8562c11 commit d298b7c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bplan/migrations/0006_add_ordering_to_bplan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.20 on 2021-06-07 11:52

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('bplan', '0005_remove_old_fields_from_bplan_model'),
]

operations = [
migrations.AlterModelOptions(
name='bplan',
options={'ordering': ['id']},
),
]
1 change: 1 addition & 0 deletions bplan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ def __str__(self):
class Meta:
index_together = [["bbg_anfang", "bbg_ende"],
["aul_anfang", "aul_ende"]]
ordering = ['id']
1 change: 1 addition & 0 deletions bplan/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,6 @@ class BPlanSerializer(SimpleBPlanSerializer, GeoFeatureModelSerializer):

class Meta:
model = BPlan
fields = '__all__'
id_field = False
geo_field = 'multipolygon'
1 change: 1 addition & 0 deletions django_zbp/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
'django_filters',
'rest_framework',
'rest_framework_gis',
'bplan',
Expand Down

0 comments on commit d298b7c

Please sign in to comment.