Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Code/API changes
* [OSDEV-1346](https://opensupplyhub.atlassian.net/browse/OSDEV-1346) - Create GET request for `v1/moderation-events` endpoint.
* [OSDEV-1429](https://opensupplyhub.atlassian.net/browse/OSDEV-1429) - The list upload switcher has been created to disable the `Submit` button on the List Contribute page through the Switch page in the Django admin panel during the release process. Implemented a check on the list upload endpoint.
* [OSDEV-1467](https://opensupplyhub.atlassian.net/browse/OSDEV-1467) - Implemented disabling endpoint `POST /api/facilities/?public=true&create=true` during the release process . It is raising error message with status code 503.
* [OSDEV-1332](https://opensupplyhub.atlassian.net/browse/OSDEV-1332) - Introduced new `PATCH api/v1/moderation-events/{moderation_id}` endpoint
to modify moderation event `status`.
* [OSDEV-1347](https://opensupplyhub.atlassian.net/browse/OSDEV-1347) - Create GET request for `v1/moderation-events/{moderation_id}` endpoint.
Expand Down
6 changes: 6 additions & 0 deletions src/django/api/views/facility/facilities_view_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from contricleaner.lib.exceptions.handler_not_set_error \
import HandlerNotSetError

from api.exceptions import ServiceUnavailableException
from api.helpers.helpers import validate_workers_count
from oar.settings import (
MAX_ATTACHMENT_SIZE_IN_BYTES,
Expand Down Expand Up @@ -576,6 +577,11 @@ def create(self, request):
""" # noqa
# Adding the @permission_classes decorator was not working so we
# explicitly invoke our custom permission class.
if switch_is_active('disable_list_uploading'):
block_message = ('Open Supply Hub is undergoing maintenance and '
'not accepting new data at the moment. Please '
'try again in a few minutes.')
raise ServiceUnavailableException(block_message)
if not IsRegisteredAndConfirmed().has_permission(request, self):
return Response(status=status.HTTP_401_UNAUTHORIZED)
if not flag_is_active(request._request,
Expand Down