Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve invitation error when user dose not exists any more #8027

Conversation

Abdu-moustafa
Copy link
Contributor

@Abdu-moustafa Abdu-moustafa commented Aug 28, 2024

This pull request addresses a recurring AttributeError encountered by users in Teamraum when handling invitations. The error was traced to an issue where a non-existent inviter was being referenced, leading to a failure in the invitation process.

For TI-1036

Before:

before

After:
after

Checklist

Everything has to be done/checked. Checked but not present means the author deemed it unnecessary.

  • Changelog entry
  • Link to issue (Jira or GitHub) and backlink in issue (Jira)

@Abdu-moustafa Abdu-moustafa marked this pull request as ready for review August 28, 2024 12:04
Copy link
Member

@phgross phgross left a comment

Choose a reason for hiding this comment

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

This is not the right way to fix this issues.

The problem should be fixed by just using the Actor.lookup() instead of the PloneUserActor in the my-invitations view
.

@Abdu-moustafa Abdu-moustafa force-pushed the amo/TI-1036/fix/invitations-attribute_error_non_exists_inviter branch from 9a820eb to 47e99d8 Compare August 28, 2024 14:07
@Abdu-moustafa
Copy link
Contributor Author

Abdu-moustafa commented Aug 28, 2024

This is not the right way to fix this issues.

The problem should be fixed by just using the Actor.lookup() instead of the PloneUserActor in the my-invitations view .

Moved the logic to the my-invitations

@Abdu-moustafa Abdu-moustafa force-pushed the amo/TI-1036/fix/invitations-attribute_error_non_exists_inviter branch 4 times, most recently from 1784aca to 7db16e6 Compare September 2, 2024 11:19
# Add the invitation to the storage
self.storage._write_invitations[invitation_id] = entry

# Resolve the inviter from the invitation
Copy link
Member

Choose a reason for hiding this comment

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

This test does not actually check whether the problem still exists or not. Instead of manually fetching the inviter and create the actor from it, you should call the my-invitations view with the test user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Abdu-moustafa Abdu-moustafa force-pushed the amo/TI-1036/fix/invitations-attribute_error_non_exists_inviter branch from 7db16e6 to 3bb6cee Compare September 3, 2024 13:42
@Abdu-moustafa Abdu-moustafa requested a review from a team September 3, 2024 13:43
Copy link
Member

@lukasgraf lukasgraf left a comment

Choose a reason for hiding this comment

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

LGTM 👍 - but changelog entry is missing.

@Abdu-moustafa Abdu-moustafa force-pushed the amo/TI-1036/fix/invitations-attribute_error_non_exists_inviter branch from 3bb6cee to d24147f Compare September 4, 2024 07:46
@Abdu-moustafa Abdu-moustafa merged commit e03d4b6 into master Sep 4, 2024
11 checks passed
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.

3 participants