Skip to content

Commit 188637b

Browse files
committed
clean up two
1 parent b5d234d commit 188637b

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

ansible_base/activitystream/models/entry.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,6 @@ class Meta:
6363
)
6464

6565
def __str__(self):
66-
# Enhanced display for RBAC role assignments
67-
if self.content_type and 'roleassignment' in self.content_type.model.lower():
68-
operation_text = self.get_operation_display()
69-
created_by_text = str(self.created_by) if self.created_by else "Unknown"
70-
return f'[{self.created}] Role assignment {operation_text.lower()} by {created_by_text}'
71-
72-
# Standard format for other entry types
7366
return f'[{self.created}] {self.get_operation_display()} by {self.created_by}: {self.content_type} {self.object_id}'
7467

7568
@functools.cached_property

test_app/tests/rbac/test_rbac_activity_stream.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ def test_role_user_assignment_activity_stream_lifecycle(system_user, admin_user,
5656
assert assignment.activity_stream_entries.count() == 1
5757
create_entry = assignment.activity_stream_entries.last()
5858
verify_activity_entry_fields(create_entry, 'create', admin_user, test_user.id, role_def.id, 'user')
59-
60-
# Verify enhanced string representation
61-
entry_str = str(create_entry)
62-
assert "Role assignment entity created by" in entry_str
63-
assert str(admin_user) in entry_str
59+
6460

6561
# Delete assignment and verify DELETE entry
6662
assignment_id = assignment.id
@@ -78,11 +74,6 @@ def test_role_user_assignment_activity_stream_lifecycle(system_user, admin_user,
7874
assert assignment_entries.count() == 2
7975
delete_entry = assignment_entries.last()
8076
verify_activity_entry_fields(delete_entry, 'delete', admin_user, test_user.id, role_def.id, 'user')
81-
82-
# Verify enhanced string representation for delete
83-
delete_str = str(delete_entry)
84-
assert "Role assignment entity deleted by" in delete_str
85-
assert str(admin_user) in delete_str
8677

8778

8879
@pytest.mark.skipif(not apps.is_installed('ansible_base.activitystream'), reason="Activity stream tests only run when activitystream app is installed")
@@ -110,11 +101,6 @@ def test_role_team_assignment_activity_stream(admin_user, team, organization):
110101
assert assignment.activity_stream_entries.count() == 1
111102
create_entry = assignment.activity_stream_entries.last()
112103
verify_activity_entry_fields(create_entry, 'create', admin_user, team.id, role_def.id, 'team')
113-
114-
# Verify enhanced string representation
115-
entry_str = str(create_entry)
116-
assert "Role assignment entity created by" in entry_str
117-
assert str(admin_user) in entry_str
118104

119105
# Delete assignment and verify DELETE entry
120106
assignment_id = assignment.id

0 commit comments

Comments
 (0)