mirror of https://github.com/zulip/zulip.git
4102816240
The target realm was not being passed to create_attachment in upload_message_file implementations. This was a bug in the edge-case of cross-realm messages - in particular, causing a bug in the email gateway: When an email with an attachment is sent, the message is mirrored to Zulip with Email Gateway Bot as the message sender and uploader of the attachment. Due to the realm not being passed to create_attachment, the Attachment would get created with .realm being the system bot realm, making the attachment inaccessible under some conditions due to failing the following condition check (that's expected to pass, provided that the .realm is set correctly): ``` if ( attachment.is_realm_public and attachment.realm == user_profile.realm and user_profile.can_access_public_streams() ): # Any user in the realm can access realm-public files return True ``` |
||
---|---|---|
.. | ||
data_import | ||
integration_fixtures/nagios | ||
lib | ||
management | ||
migrations | ||
openapi | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py |