SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
dda7627b
Commit
dda7627b
authored
3 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Add public-facing API for Subsidies
parent
0f2284ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scipost_django/api/urls.py
+5
-1
5 additions, 1 deletion
scipost_django/api/urls.py
scipost_django/finances/api/viewsets.py
+6
-1
6 additions, 1 deletion
scipost_django/finances/api/viewsets.py
with
11 additions
and
2 deletions
scipost_django/api/urls.py
+
5
−
1
View file @
dda7627b
...
...
@@ -23,7 +23,10 @@ from organizations.api.viewsets import (
)
# finances
from
finances.api.viewsets
import
SubsidyFinAdminAPIViewSet
from
finances.api.viewsets
import
(
SubsidyFinAdminAPIViewSet
,
SubsidyPublicAPIViewSet
)
# Next two: old style, to be deprecated:
...
...
@@ -53,6 +56,7 @@ router.register('nap', OrganizationNAPViewSet)
# finances
router
.
register
(
'
finadmin/subsidies
'
,
SubsidyFinAdminAPIViewSet
)
router
.
register
(
'
subsidies
'
,
SubsidyPublicAPIViewSet
)
# Next two: old style, to be deprecated:
router
.
register
(
r
'
news
'
,
NewsItemViewSet
)
...
...
This diff is collapsed.
Click to expand it.
scipost_django/finances/api/viewsets.py
+
6
−
1
View file @
dda7627b
...
...
@@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__
=
"
AGPL v3
"
from
rest_framework.permissions
import
BasePermission
from
rest_framework.permissions
import
AllowAny
,
BasePermission
from
rest_framework.settings
import
api_settings
from
rest_framework_csv
import
renderers
as
r
...
...
@@ -40,3 +40,8 @@ class SubsidyFinAdminAPIViewSet(
'
organization__name__icontains
'
,
'
organization__acronym__icontains
'
]
class
SubsidyPublicAPIViewSet
(
SubsidyFinAdminAPIViewSet
):
queryset
=
Subsidy
.
objects
.
filter
(
amount_publicly_shown
=
True
)
permission_classes
=
[
AllowAny
,]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment