Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
e485f2a
test CI
Ostap-Zherebetskyi Apr 22, 2025
a968f71
remove osf groups
Ostap-Zherebetskyi May 1, 2025
509d958
remove osf groups
Ostap-Zherebetskyi May 1, 2025
ff7244b
remove osf groups
Ostap-Zherebetskyi May 1, 2025
0d78f9e
remove osf groups
Ostap-Zherebetskyi May 1, 2025
c217e04
remove osf groups
Ostap-Zherebetskyi May 1, 2025
878d2c7
Merge pull request #11122 from Ostap-Zherebetskyi/feature/osfgroup
Johnetordoff May 12, 2025
e1eb72a
Remove Meetings, Comments and OSF Groups Notifications
Ostap-Zherebetskyi May 7, 2025
b20470f
Clean up imports
Ostap-Zherebetskyi May 8, 2025
b011991
Clean up tests
Ostap-Zherebetskyi May 8, 2025
d9004bc
Clean up tests
Ostap-Zherebetskyi May 8, 2025
2d3d1c0
Merge pull request #11133 from Ostap-Zherebetskyi/feature/ENG-7908-re…
Johnetordoff May 12, 2025
91d048d
Update send_mail mocks
Ostap-Zherebetskyi May 19, 2025
57b0bd1
add new data model for notifications
Johnetordoff May 20, 2025
929b9fd
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff May 22, 2025
69231e9
add new notificationsubscription class to views
Johnetordoff May 27, 2025
a8b5727
update mails mock
Ostap-Zherebetskyi May 28, 2025
c324716
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff May 28, 2025
40b38f7
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff May 30, 2025
73cc32f
remove quickfiles
bodintsov Jun 2, 2025
d109be9
fixed tests
bodintsov Jun 2, 2025
41b3a72
flake8
bodintsov Jun 3, 2025
e8d1370
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 3, 2025
3fda17f
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 3, 2025
1a2f7c1
Merge branch 'feature/remove-remaining-quickiles-code' of https://git…
Johnetordoff Jun 3, 2025
013d422
Merge branch 'feature/remove_test_speed-up' of https://github.com/Ost…
Johnetordoff Jun 3, 2025
f7f8197
Merge pull request #11167 from Johnetordoff/feature/notification-refa…
Johnetordoff Jun 3, 2025
358091c
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 3, 2025
5165ab9
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 3, 2025
fbc7d3f
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 3, 2025
22c62df
ignore Django maintenance state outside block
Johnetordoff Jun 5, 2025
1c7e2d2
Add MailHog email testing functionality
Ostap-Zherebetskyi Jun 5, 2025
09cf6e8
fix new and noteworth nodes bug going to Sentry
Johnetordoff Jun 8, 2025
2ab3589
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 9, 2025
c449599
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 9, 2025
97b97ab
remove superfluildous `groups` from serializer
Johnetordoff Jun 9, 2025
a68e12c
Merge pull request #11177 from Johnetordoff/refactor-notifications
Johnetordoff Jun 9, 2025
e0a0765
add mailhog unit tests
Ostap-Zherebetskyi Jun 10, 2025
1b70ff2
update CI
Ostap-Zherebetskyi Jun 10, 2025
62f0fd9
fixed bug with contributors
bodintsov Jun 11, 2025
0907a7d
Merge pull request #11181 from bodintsov/fix/fix-contributors-not-sho…
Johnetordoff Jun 11, 2025
d83c2c3
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 13, 2025
1764be0
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jun 16, 2025
f550c61
fix absolute url issue
Johnetordoff Jun 16, 2025
458fbfd
fix up unit test issues
Johnetordoff Jun 16, 2025
e0c54dd
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 17, 2025
16c5409
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 25, 2025
5864187
Merge branch 'feature/pbs-25-10' of https://github.com/CenterForOpenS…
Johnetordoff Jun 30, 2025
bb145f4
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 30, 2025
a2c6022
Merge pull request #11107 from Ostap-Zherebetskyi/feature/old_templates
Johnetordoff Jun 30, 2025
cf621c3
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jun 30, 2025
87d3276
mailhog ci update
Ostap-Zherebetskyi Jul 1, 2025
2f102f7
Merge pull request #11170 from Ostap-Zherebetskyi/feature/update_mail…
Johnetordoff Jul 2, 2025
b62daac
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 2, 2025
300524c
fix backward compat issues and remove old tests
Johnetordoff Jul 2, 2025
3a682b3
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 7, 2025
85e1342
split notification models into 3 files and improve interval choices
Johnetordoff Jul 7, 2025
9a10a63
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 7, 2025
f2e5309
clean-up tests and pass frequency data properly
Johnetordoff Jul 8, 2025
0471b76
update management commands and tests for notification migration
Johnetordoff Jul 8, 2025
78e968c
Upgrade User Confirmation Registrations
Ostap-Zherebetskyi Jul 7, 2025
1affb5e
fix unit tests
Ostap-Zherebetskyi Jul 9, 2025
2dee1b2
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 9, 2025
72623cc
fix unit tests
Ostap-Zherebetskyi Jul 9, 2025
2da68ad
Merge remote-tracking branch 'upstream/refactor-notifications' into f…
Ostap-Zherebetskyi Jul 9, 2025
a02352c
fix unit tests
Ostap-Zherebetskyi Jul 9, 2025
ff9743b
fix unit tests
Ostap-Zherebetskyi Jul 9, 2025
feba563
fix unit tests
Ostap-Zherebetskyi Jul 10, 2025
90ef652
fix unit tests
Ostap-Zherebetskyi Jul 10, 2025
0c003f5
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 10, 2025
8743277
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jul 10, 2025
e3bc742
remove old management commands and add new ones to population notific…
Johnetordoff Jul 10, 2025
cd0bc26
Merge branch 'add-new-notifications-data-model' into feature/user_con…
Johnetordoff Jul 10, 2025
2dbcbf7
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 9, 2025
b0d8bdc
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jul 10, 2025
e47c9e8
Merge branch 'develop' of https://github.com/CenterForOpenScience/osf…
Johnetordoff Jul 9, 2025
37b419a
fix issues with migrate schema response task deletion
Johnetordoff Jul 10, 2025
0657c03
Merge branch 'add-new-notifications-data-model' into feature/user_con…
Johnetordoff Jul 11, 2025
03cad99
fix issues with migrate schema response task deletion
Johnetordoff Jul 11, 2025
4a4167f
Merge pull request #249 from Johnetordoff/feature/user_confirmation
Johnetordoff Jul 11, 2025
c37366c
Merge branch 'add-new-notifications-data-model' of github.com:johneto…
Johnetordoff Jul 11, 2025
b6bbeed
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jul 10, 2025
f257fb6
Merge branch 'refactor-notifications' of https://github.com/CenterFor…
Johnetordoff Jul 15, 2025
4c69f7e
Update notifications for withdraw and retraction types
Johnetordoff Jul 15, 2025
da9712f
clean-up user confirmation emails
Johnetordoff Jul 15, 2025
928d0c1
add file update notifications types
Johnetordoff Jul 15, 2025
ff0ba30
fix typo
Johnetordoff Jul 15, 2025
55e155d
add for institutional access emails
Johnetordoff Jul 15, 2025
d43de2b
fix embargo sanctions typo
Johnetordoff Jul 16, 2025
9776d92
fix mocks for institutional access tests
Johnetordoff Jul 16, 2025
cfc1f97
fix file added updates for notifications
Johnetordoff Jul 16, 2025
2feec4a
add notification type emit for institutional requests
Johnetordoff Jul 16, 2025
f3965f7
add notification type emit for contributor added to provider for prep…
Johnetordoff Jul 17, 2025
19c838d
add external login link success notification type
Johnetordoff Jul 17, 2025
c1bfdf3
populate notification types in OSF Gather tests
Johnetordoff Jul 17, 2025
a6e3ee8
update the file operations to use new notifications system
Johnetordoff Jul 17, 2025
0d17c05
update more notifications to use NotificationType
Johnetordoff Jul 18, 2025
ccaf2c4
update crossref messages to new notification system
Johnetordoff Jul 18, 2025
d0f671f
update messages for primary_email and exports to new notification system
Johnetordoff Jul 18, 2025
ecb3696
clean-up mailhog and populate notification types code
Johnetordoff Jul 18, 2025
c2a7299
clean up contributor tests and save behavior for notifications
Johnetordoff Jul 21, 2025
d0cf3c7
clean-up syntax for tests
Johnetordoff Jul 21, 2025
8c56b03
add Schema response to notificationTypes
Johnetordoff Jul 21, 2025
4db559a
add NotificationTypes for desk messages
Johnetordoff Jul 21, 2025
fd6e167
fix up draft registration tests
Johnetordoff Jul 21, 2025
1602dc9
simplify institutional access request notification code
Johnetordoff Jul 21, 2025
b7c2e98
use NotificationType model for withdrawal requests
Johnetordoff Jul 21, 2025
8d6582f
fix preprint contributor notification tests and withdraw request noti…
Johnetordoff Jul 21, 2025
dcaf9bd
Add NotificationTypes for duplicate accounts
Johnetordoff Jul 21, 2025
918f6cf
fix notification tests for node and preprint requests
Johnetordoff Jul 22, 2025
f756568
update email templates to support JSON event context
Johnetordoff Jul 22, 2025
ed5342c
add more provider notificationtypes
Johnetordoff Jul 22, 2025
b3ca1b8
fix up user claim message notification tests
Johnetordoff Jul 22, 2025
2ac9ef9
add bulk registration upload notifications to tests
Johnetordoff Jul 22, 2025
9815f1f
fix issues with notifications when adding nodes to instituions
Johnetordoff Jul 22, 2025
7c08559
fix issues with collection submissions notifications
Johnetordoff Jul 23, 2025
86a9466
fix reviewable and contributor notifications
Johnetordoff Jul 23, 2025
73f1aec
added metrics
bodintsov Jul 25, 2025
260416d
remove litter
bodintsov Jul 25, 2025
fa99340
added unittests for Notification metrics report
bodintsov Jul 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
ELASTICSEARCH6_ARCHIVE: elasticsearch-6.3.1.tar.gz
OSF_DB_PORT: 5432
OSF_DB_PASSWORD: postgres
GITHUB_ACTIONS: true

jobs:
build-cache:
Expand Down Expand Up @@ -167,3 +168,36 @@ jobs:
- name: Upload report
if: (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report

mailhog:
runs-on: ubuntu-22.04
permissions:
checks: write
needs: build-cache
services:
postgres:
image: postgres

env:
POSTGRES_PASSWORD: ${{ env.OSF_DB_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
mailhog:
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-ci-mailhog -n 1 --junit
- name: Upload report
if: (github.event_name != 'pull_request') && (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
6 changes: 2 additions & 4 deletions README-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,8 @@
docker compose run --rm web python3 -m scripts.parse_citation_styles
```
- Start ember_osf_web
- Needed for quickfiles feature:
```bash
docker compose up -d ember_osf_web
```
- Needed for ember app:
- `docker-compose up -d ember_osf_web`
- OPTIONAL: Register OAuth Scopes
- Needed for things such as the ember-osf dummy app
```bash
Expand Down
81 changes: 50 additions & 31 deletions addons/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from addons.base import exceptions as addon_errors
from addons.base.models import BaseStorageAddon
from addons.osfstorage.models import OsfStorageFile
from addons.osfstorage.models import OsfStorageFileNode
from addons.osfstorage.utils import enqueue_update_analytics

Expand All @@ -34,9 +33,7 @@
from framework.exceptions import HTTPError
from framework.flask import redirect
from framework.sentry import log_exception
from framework.routing import proxy_url
from framework.transactions.handlers import no_auto_transaction
from website import mails
from website import settings
from addons.base import signals as file_signals
from addons.base.utils import format_last_known_metadata, get_mfr_url
Expand All @@ -54,11 +51,12 @@
DraftRegistration,
Guid,
FileVersionUserMetadata,
FileVersion
FileVersion, NotificationType
)
from osf.metrics import PreprintView, PreprintDownload
from osf.utils import permissions
from osf.external.gravy_valet import request_helpers
from website.notifications.emails import localize_timestamp
from website.profile.utils import get_profile_image_url
from website.project import decorators
from website.project.decorators import must_be_contributor_or_public, must_be_valid_project, check_contributor_auth
Expand Down Expand Up @@ -483,7 +481,7 @@ def _construct_payload(auth, resource, credentials, waterbutler_settings):

@must_be_signed
@no_auto_transaction
@must_be_valid_project(quickfiles_valid=True, preprints_valid=True)
@must_be_valid_project(preprints_valid=True)
def create_waterbutler_log(payload, **kwargs):
with transaction.atomic():
try:
Expand Down Expand Up @@ -578,20 +576,24 @@ def create_waterbutler_log(payload, **kwargs):
params=payload
)

if payload.get('email') is True or payload.get('errors'):
mails.send_mail(
user.username,
mails.FILE_OPERATION_FAILED if payload.get('errors')
else mails.FILE_OPERATION_SUCCESS,
action=payload['action'],
source_node=source_node,
destination_node=destination_node,
source_path=payload['source']['materialized'],
source_addon=payload['source']['addon'],
destination_addon=payload['destination']['addon'],
osf_support_email=settings.OSF_SUPPORT_EMAIL
if payload.get('email') or payload.get('errors'):
if payload.get('email'):
notification_type = NotificationType.Type.FILE_OPERATION_SUCCESS
if payload.get('errors'):
notification_type = NotificationType.Type.FILE_OPERATION_FAILED

NotificationType.objects.get(name=notification_type.value).emit(
user=user,
event_context={
'action': payload['action'],
'source_node': source_node,
'destination_node': destination_node,
'source_path': payload['source']['materialized'],
'source_addon': payload['source']['addon'],
'destination_addon': payload['destination']['addon'],
'osf_support_email': settings.OSF_SUPPORT_EMAIL
}
)

if payload.get('errors'):
# Action failed but our function succeeded
# Bail out to avoid file_signals
Expand All @@ -603,11 +605,38 @@ def create_waterbutler_log(payload, **kwargs):
metadata = payload.get('metadata') or payload.get('destination')

target_node = AbstractNode.load(metadata.get('nid'))
if target_node and not target_node.is_quickfiles and payload['action'] != 'download_file':
if target_node and payload['action'] != 'download_file':
update_storage_usage_with_size(payload)

with transaction.atomic():
file_signals.file_updated.send(target=node, user=user, event_type=action, payload=payload)
file_signals.file_updated.send(target=node, user=user, event_type=action, payload=payload)

match f'node_{action}':
case NotificationType.Type.NODE_FILE_ADDED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_FILE_ADDED)
case NotificationType.Type.NODE_FILE_REMOVED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_FILE_REMOVED)
case NotificationType.Type.NODE_FILE_UPDATED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_FILE_UPDATED)
case NotificationType.Type.NODE_ADDON_FILE_RENAMED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_ADDON_FILE_RENAMED)
case NotificationType.Type.NODE_ADDON_FILE_COPIED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_ADDON_FILE_COPIED)
case NotificationType.Type.NODE_ADDON_FILE_REMOVED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_ADDON_FILE_REMOVED)
case NotificationType.Type.NODE_ADDON_FILE_MOVED:
notification = NotificationType.objects.get(name=NotificationType.Type.NODE_ADDON_FILE_MOVED)
case _:
raise NotImplementedError(f'action {action} not implemented')

notification.emit(
user=user,
event_context={
'profile_image_url': user.profile_image_url(),
'localized_timestamp': localize_timestamp(timezone.now(), user),
'user_fullname': user.fullname,
'url': node.absolute_url,
}
)

return {'status': 'success'}

Expand Down Expand Up @@ -1032,16 +1061,6 @@ def persistent_file_download(auth, **kwargs):
)


def addon_view_or_download_quickfile(**kwargs):
fid = kwargs.get('fid', 'NOT_AN_FID')
file_ = OsfStorageFile.load(fid)
if not file_:
raise HTTPError(http_status.HTTP_404_NOT_FOUND, data={
'message_short': 'File Not Found',
'message_long': 'The requested file could not be found.'
})
return proxy_url(f'/project/{file_.target._id}/files/osfstorage/{fid}/')

def addon_view_file(auth, node, file_node, version):
# TODO: resolve circular import issue
from addons.wiki import settings as wiki_settings
Expand Down
47 changes: 13 additions & 34 deletions addons/boa/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def setUp(self):
self.output_file_name = 'fake_boa_script_results.txt'
self.job_id = '1a2b3c4d5e6f7g8'

from conftest import start_mock_send_grid
self.mock_send_grid = start_mock_send_grid(self)

def tearDown(self):
super().tearDown()

Expand All @@ -52,9 +55,10 @@ def test_boa_error_code(self):
assert BoaErrorCode.FILE_TOO_LARGE_ERROR == 6
assert BoaErrorCode.JOB_TIME_OUT_ERROR == 7

@mock.patch('website.mails.settings.USE_EMAIL', True)
@mock.patch('website.mails.settings.USE_CELERY', False)
def test_handle_boa_error(self):
with mock.patch('addons.boa.tasks.send_mail', return_value=None) as mock_send_mail, \
mock.patch('addons.boa.tasks.sentry.log_message', return_value=None) as mock_sentry_log_message, \
with mock.patch('addons.boa.tasks.sentry.log_message', return_value=None) as mock_sentry_log_message, \
mock.patch('addons.boa.tasks.logger.error', return_value=None) as mock_logger_error:
return_value = handle_boa_error(
self.error_message,
Expand All @@ -68,24 +72,7 @@ def test_handle_boa_error(self):
output_file_name=self.output_file_name,
job_id=self.job_id
)
mock_send_mail.assert_called_with(
to_addr=self.user_username,
mail=ADDONS_BOA_JOB_FAILURE,
fullname=self.user_fullname,
code=BoaErrorCode.UNKNOWN,
message=self.error_message,
query_file_name=self.query_file_name,
file_size=self.file_size,
max_file_size=boa_settings.MAX_SUBMISSION_SIZE,
query_file_full_path=self.file_full_path,
output_file_name=self.output_file_name,
job_id=self.job_id,
max_job_wait_hours=self.max_job_wait_hours,
project_url=self.project_url,
boa_job_list_url=boa_settings.BOA_JOB_LIST_URL,
boa_support_email=boa_settings.BOA_SUPPORT_EMAIL,
osf_support_email=osf_settings.OSF_SUPPORT_EMAIL,
)
self.mock_send_grid.assert_called()
mock_sentry_log_message.assert_called_with(self.error_message, skip_session=True)
mock_logger_error.assert_called_with(self.error_message)
assert return_value == BoaErrorCode.UNKNOWN
Expand Down Expand Up @@ -167,9 +154,14 @@ def setUp(self):
boa_settings.REFRESH_JOB_INTERVAL = DEFAULT_REFRESH_JOB_INTERVAL
boa_settings.MAX_JOB_WAITING_TIME = DEFAULT_MAX_JOB_WAITING_TIME

from conftest import start_mock_send_grid
self.mock_send_grid = start_mock_send_grid(self)

def tearDown(self):
super().tearDown()

@mock.patch('website.mails.settings.USE_EMAIL', True)
@mock.patch('website.mails.settings.USE_CELERY', False)
async def test_submit_success(self):
with mock.patch('osf.models.user.OSFUser.objects.get', return_value=self.user), \
mock.patch('osf.models.user.OSFUser.get_or_create_cookie', return_value=self.user_cookie), \
Expand All @@ -179,7 +171,6 @@ async def test_submit_success(self):
mock.patch('boaapi.boa_client.BoaClient.query', return_value=self.mock_job), \
mock.patch('boaapi.boa_client.BoaClient.close', return_value=None) as mock_close, \
mock.patch('asyncio.sleep', new_callable=AsyncMock, return_value=None) as mock_async_sleep, \
mock.patch('addons.boa.tasks.send_mail', return_value=None) as mock_send_mail, \
mock.patch('addons.boa.tasks.handle_boa_error', return_value=None) as mock_handle_boa_error:
return_value = await submit_to_boa_async(
self.host,
Expand All @@ -199,19 +190,7 @@ async def test_submit_success(self):
assert self.mock_job.refresh.call_count == 4
assert mock_async_sleep.call_count == 4
mock_close.assert_called()
mock_send_mail.assert_called_with(
to_addr=self.user.username,
mail=ADDONS_BOA_JOB_COMPLETE,
fullname=self.user.fullname,
query_file_name=self.query_file_name,
query_file_full_path=self.file_full_path,
output_file_name=self.output_file_name,
job_id=self.mock_job.id,
project_url=self.project_url,
boa_job_list_url=boa_settings.BOA_JOB_LIST_URL,
boa_support_email=boa_settings.BOA_SUPPORT_EMAIL,
osf_support_email=osf_settings.OSF_SUPPORT_EMAIL,
)
self.mock_send_grid.assert_called()
mock_handle_boa_error.assert_not_called()

async def test_download_error(self):
Expand Down
2 changes: 1 addition & 1 deletion addons/osfstorage/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from framework.auth import cas

from osf import features
from osf.models import Tag, QuickFilesNode
from osf.models import Tag
from osf.models import files as models
from addons.osfstorage.apps import osf_storage_root
from addons.osfstorage import utils
Expand Down
3 changes: 0 additions & 3 deletions addons/osfstorage/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ def osfstorage_create_child(file_node, payload, **kwargs):
if not (name or user) or '/' in name:
raise HTTPError(http_status.HTTP_400_BAD_REQUEST)

if getattr(file_node.target, 'is_quickfiles', False) and is_folder:
raise HTTPError(http_status.HTTP_400_BAD_REQUEST, data={'message_long': 'You may not create a folder for QuickFiles'})

try:
# Create a save point so that we can rollback and unlock
# the parent record
Expand Down
1 change: 0 additions & 1 deletion admin/base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
re_path(r'^maintenance/', include('admin.maintenance.urls', namespace='maintenance')),
re_path(r'^meetings/', include('admin.meetings.urls', namespace='meetings')),
re_path(r'^metrics/', include('admin.metrics.urls', namespace='metrics')),
re_path(r'^osf_groups/', include('admin.osf_groups.urls', namespace='osf_groups')),
re_path(r'^management/', include('admin.management.urls', namespace='management')),
re_path(r'^internet_archive/', include('admin.internet_archive.urls', namespace='internet_archive')),
re_path(r'^schema_responses/', include('admin.schema_responses.urls', namespace='schema_responses')),
Expand Down
2 changes: 1 addition & 1 deletion admin/common_auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserRegistrationForm(forms.Form):

# TODO: Moving to guardian, find a better way to distinguish "admin-like" groups from object permission groups
group_perms = forms.ModelMultipleChoiceField(
queryset=Group.objects.exclude(Q(name__startswith='collections_') | Q(name__startswith='reviews_') | Q(name__startswith='preprint_') | Q(name__startswith='node_') | Q(name__startswith='osfgroup_') | Q(name__startswith='draft_registration_')),
queryset=Group.objects.exclude(Q(name__startswith='collections_') | Q(name__startswith='reviews_') | Q(name__startswith='preprint_') | Q(name__startswith='node_') | Q(name__startswith='draft_registration_')),
required=False,
widget=forms.CheckboxSelectMultiple
)
Expand Down
5 changes: 0 additions & 5 deletions admin/nodes/templatetags/node_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ def reverse_user(user):
return reverse('users:user', kwargs={'guid': user._id})


@register.filter
def reverse_osf_group(value):
return reverse('osf_groups:osf_group', kwargs={'id': value._id})


@register.filter
def reverse_registration_provider(value):
return reverse('registration_providers:detail', kwargs={'registration_provider_id': value.provider.id})
Expand Down
8 changes: 4 additions & 4 deletions admin/notifications/views.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from osf.models.notifications import NotificationSubscription
from osf.models.notifications import NotificationSubscriptionLegacy
from django.db.models import Count

def delete_selected_notifications(selected_ids):
NotificationSubscription.objects.filter(id__in=selected_ids).delete()
NotificationSubscriptionLegacy.objects.filter(id__in=selected_ids).delete()

def detect_duplicate_notifications(node_id=None):
query = NotificationSubscription.objects.values('_id').annotate(count=Count('_id')).filter(count__gt=1)
query = NotificationSubscriptionLegacy.objects.values('_id').annotate(count=Count('_id')).filter(count__gt=1)
if node_id:
query = query.filter(node_id=node_id)

detailed_duplicates = []
for dup in query:
notifications = NotificationSubscription.objects.filter(
notifications = NotificationSubscriptionLegacy.objects.filter(
_id=dup['_id']
).order_by('created')

Expand Down
Empty file removed admin/osf_groups/__init__.py
Empty file.
6 changes: 0 additions & 6 deletions admin/osf_groups/forms.py

This file was deleted.

10 changes: 0 additions & 10 deletions admin/osf_groups/urls.py

This file was deleted.

Loading
Loading