Skip to content

Conversation

@Johnetordoff
Copy link
Contributor

@Johnetordoff Johnetordoff commented Nov 2, 2025

Purpose

Revert accidental merge with develop, fixes issues with CI not running and fixes unrun tests.

Changes

  • revert a bunch of changes to legacy routes that was causing test failures
  • re-re-instate removal of osf_groups tests removal
  • re-fix collection submission tests
  • re-reinstroduce the expect_errors=True, for custom item metadata
  • re-reintroduce removal of old TestFlaskDjangoIntegration legacy tests
  • fix notifications digest tests and stop using provider id and use the subscription subscribed object
  • fix logo template problems effecting the moderator templates

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket


for guid, value in user.unclaimed_records.items():
obj = Guid.load(guid)
url = f'{DOMAIN}legacy/user/{user._id}/{guid}/claim/?token={value["token"]}'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

validated_data,
)

class NodeContributorsUpdateSerializer(ser.Serializer):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

DraftRegistrationDetailLegacySerializer,
NodeContributorsSerializer,
NodeContributorDetailSerializer,
NodeContributorsUpdateSerializer,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

def get_resource(self):
return self.get_node()

def get_object(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

"""
Use NodeContributorDetailSerializer which requires 'id'
"""
if self.request.method == 'PATCH' and self.request.query_params.get('copy_contributors_from_parent_project'):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

context['default_email'] = 'default'
return context

def patch(self, request, *args, **kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was in the current develop, it caused the claim email tests to fail.

preprint.date_last_transitioned = None
preprint.save()
payload = self.create_payload(preprint._id, trigger=trigger)
with capture_notifications():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to covered in mocked and non-mocked state due to the parameterization of tests

assert attributes['permission'] == permissions.WRITE
assert project.get_permissions(user) == [permissions.READ, permissions.WRITE]

def test_update_component_project_with_parent_contributors(self, app, user, component_project_and_parent_project):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part of develop and was causing tests to fail so had to be reverted,

collection_public.collect_object(node_one, user)
collection_public.collect_object(node_two, user)
collection_public.collect_object(node_private, user)
with capture_notifications():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These had to have these mocks reintroduced.

# test_search_collections_by_submission_abstract
collection_public.collect_object(node_with_abstract, user)
registration_collection.collect_object(reg_with_abstract, user)
with capture_notifications():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These had to have these mocks reintroduced.

collection_public.collect_object(node_two, user, collected_type='asdf', status='lkjh')
collection_public.collect_object(node_with_abstract, user, status='asdf', grade_levels='super')
collection_public.collect_object(node_private, user, status='asdf', collected_type='asdf')
with capture_notifications():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These had to have these mocks reintroduced.


collection_public.collect_object(node_one, user, disease='illness', data_type='realness')
collection_public.collect_object(node_two, user, data_type='realness')
with capture_notifications():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These had to have these mocks reintroduced.

base_url = website_settings.DOMAIN if external else '/'
unclaimed_record = self.get_unclaimed_record(project_id)
token = unclaimed_record['token']
return f'{base_url}legacy/user/{uid}/{project_id}/claim/?token={token}'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stuff added from develop that was causing tests to fail

domain = settings.DOMAIN
assert (
unreg_user.get_claim_url(pid, external=True) ==
f'{domain}legacy/user/{uid}/{pid}/claim/?token={token}'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stuff added from develop that was causing tests to fail

domain = settings.DOMAIN
assert (
unreg_moderator.get_claim_url(pid, external=True) ==
f'{domain}legacy/user/{uid}/{pid}/claim/?token={token}'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stuff added from develop that was causing tests to fail

# user will be required to set email and password
# claim token must be present in query parameter
Rule(
['/legacy/user/<uid>/<pid>/claim/'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some stuff added from develop that was causing tests to fail

% if logo not in osf_logo_list:
<img src="https://raw.githubusercontent.com/CenterForOpenScience/osf-assets/master/files/preprints-assets/${logo}/wide_white.png" alt="OSF logo" style="border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;">
%else:
<img src="https://osf.io/static/img/${logo' or osf_logo)}.png" alt="OSF logo" style="border: 0;height: auto;line-height: 100%;outline: none;text-decoration: none;">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template problems effecting the moderator templates

@Johnetordoff Johnetordoff marked this pull request as ready for review November 3, 2025 14:06
@Johnetordoff Johnetordoff force-pushed the feature/notification-refactor-p2-s branch from 9ba5b23 to 6582cc1 Compare November 3, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant