Get a randomized list of featured projects if discover mode is enabled
parent
ecf5107818
commit
19121220d6
|
@ -15,12 +15,10 @@
|
||||||
- CSV Reports:
|
- CSV Reports:
|
||||||
- Change field name: 'milestone' to 'sprint'
|
- Change field name: 'milestone' to 'sprint'
|
||||||
- Add new fields: 'sprint_estimated_start' and 'sprint_estimated_end'
|
- Add new fields: 'sprint_estimated_start' and 'sprint_estimated_end'
|
||||||
|
|
||||||
### Misc
|
|
||||||
- Add sprint name and slug on search results for user stories ((thanks to [@everblut](https://github.com/everblut)))
|
- Add sprint name and slug on search results for user stories ((thanks to [@everblut](https://github.com/everblut)))
|
||||||
|
- [API] projects resource: Random order if `discover_mode=true` and `is_featured=true`.
|
||||||
- Lots of small and not so small bugfixes.
|
- Lots of small and not so small bugfixes.
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0 Pulsatilla Patens (2016-04-04)
|
## 2.0.0 Pulsatilla Patens (2016-04-04)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
|
@ -40,6 +40,10 @@ class DiscoverModeFilterBackend(FilterBackend):
|
||||||
qs = qs.filter(anon_permissions__contains=["view_project"],
|
qs = qs.filter(anon_permissions__contains=["view_project"],
|
||||||
blocked_code__isnull=True)
|
blocked_code__isnull=True)
|
||||||
|
|
||||||
|
# random order for featured projects
|
||||||
|
if request.QUERY_PARAMS.get("is_featured", None) == 'true':
|
||||||
|
qs = qs.order_by("?")
|
||||||
|
|
||||||
return super().filter_queryset(request, qs.distinct(), view)
|
return super().filter_queryset(request, qs.distinct(), view)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue