mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
refactor: Add get_stream_by_narrow_operand_access_unchecked.
This let's us clean up the linter that excludes the use of get_stream and by adding the access_unchecked in the name we make it clear that it should be used with caution. Refactoring idea by Tim Abbott.
This commit is contained in:
committed by
Tim Abbott
parent
1f8f8867cd
commit
463ecb375f
@@ -395,10 +395,6 @@ python_rules = RuleList(
|
||||
# how most instances are written, but better to exclude something than nothing
|
||||
('zerver/lib/actions.py', 'stream = get_stream(stream_name, realm)'),
|
||||
('zerver/lib/actions.py', 'get_stream(admin_realm_signup_notifications_stream, admin_realm)'),
|
||||
# Here we need get_stream to access streams you've since unsubscribed from.
|
||||
('zerver/views/messages.py', 'stream = get_stream(operand, self.user_profile.realm)'),
|
||||
# Use stream_id to exclude mutes.
|
||||
('zerver/views/messages.py', 'stream_id = get_stream(stream_name, user_profile.realm).id'),
|
||||
]),
|
||||
'description': 'Please use access_stream_by_*() to fetch Stream objects',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user