Skip to content

Commit

Permalink
Add slug to mobile API
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaël UTARD committed Apr 19, 2019
1 parent c3091b7 commit 59d3133
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion geotrek/api/mobile/serializers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_pictogram(self, obj):

class Meta:
model = trekking_models.Practice
fields = ('id', 'name', 'pictogram', 'color')
fields = ('id', 'name', 'slug', 'pictogram', 'color')

class AccessibilitySerializer(serializers.ModelSerializer):
pictogram = serializers.SerializerMethodField(read_only=True)
Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/mobile/serializers/trekking.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Meta:
geo_field = 'geometry'
auto_bbox = True
fields = (
'id', 'pk', 'name', 'accessibilities', 'description_teaser', 'cities', 'profile',
'id', 'pk', 'name', 'slug', 'accessibilities', 'description_teaser', 'cities', 'profile',
'description', 'departure', 'arrival', 'duration', 'access', 'advised_parking', 'advice',
'difficulty', 'length', 'ascent', 'descent', 'route', 'is_park_centered', 'parking_location',
'min_elevation', 'max_elevation', 'themes', 'networks', 'practice', 'difficulty',
Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/tests/test_mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
])

TREK_DETAIL_PROPERTIES_GEOJSON_STRUCTURE = sorted([
'id', 'name', 'accessibilities', 'description_teaser', 'cities', 'description', 'departure', 'arrival',
'id', 'name', 'slug', 'accessibilities', 'description_teaser', 'cities', 'description', 'departure', 'arrival',
'access', 'advised_parking', 'advice', 'difficulty', 'length', 'ascent', 'descent', 'route', 'duration',
'is_park_centered', 'min_elevation', 'max_elevation', 'themes', 'networks', 'practice', 'pictures',
'information_desks', 'departure_city', 'arrival_city', 'parking_location', 'profile'
Expand Down
2 changes: 1 addition & 1 deletion geotrek/api/tests/test_sync_mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def test_sync_treks_by_pk(self):
with open(os.path.join('tmp', 'en', '{pk}'.format(pk=str(self.trek_1.pk)),
'trek.geojson'), 'r') as f:
trek_geojson = json.load(f)
self.assertEqual(len(trek_geojson['properties']), 29)
self.assertEqual(len(trek_geojson['properties']), 30)

self.assertIn('en/{pk}/trek.geojson'.format(pk=str(self.trek_1.pk)), output.getvalue())

Expand Down

0 comments on commit 59d3133

Please sign in to comment.