zulip/zerver/lib
Steve Howell 81e3f489f2 Use sender realm in user_profiles_from_unvalidated_emails.
This change is mostly based on a similar commit from hackerkid
in a feature branch.  It borrows both code and ideas.  Some of
it's my own stuff, as I was working on a newer branch.

We now call get_user_including_cross_realm_email() inside of
user_profiles_from_unvalidated_emails(), instead of using
get_user_profile_by_email.

This requires a few of our callers to pass down sender into us.

One consequence of this change is that we change the symptoms
for trying to send to emails outside of your realm.  In some
cases, we simply raise an error that an email is invalid to us
instead of getting into the deeper validate_recipient_user_profiles
check.
2017-08-22 10:42:15 -07:00
..
bugdown bugdown: Fix mypy error with empty return. 2017-08-16 11:29:12 -07:00
url_preview preview.py: Fix error raised on uploading file with unicode filename. 2017-06-19 14:58:44 -04:00
webhooks mypy: strict optional fixes. 2017-05-24 18:50:59 -07:00
__init__.py
actions.py Use sender realm in user_profiles_from_unvalidated_emails. 2017-08-22 10:42:15 -07:00
addressee.py Use sender realm in user_profiles_from_unvalidated_emails. 2017-08-22 10:42:15 -07:00
alert_words.py mypy: Convert zerver/lib to use typing.Text. 2016-12-25 10:33:45 -08:00
attachments.py Add support for managing and deleting attachments. 2017-02-16 23:44:44 -08:00
avatar.py Make user_id, realm_id mandatory in _get_unversioned_avatar_url. 2017-07-17 21:01:30 +00:00
avatar_hash.py avatar_hash: Update a comment to reflect the current code. 2017-06-26 15:15:32 -07:00
bot_lib.py lint: Add a lint check for bare `type: ignore`s. 2017-07-27 16:31:55 -07:00
bulk_create.py populate_db: Sort the streams according to their name before creating them. 2017-07-16 20:51:08 +00:00
cache.py bots: Add UI to view bot types of existing bots in "Your bots". 2017-06-15 10:08:31 -07:00
cache_helpers.py models: Add get_user function. 2017-05-22 11:26:44 -07:00
camo.py pep8: Add compliance with rule E261 to camo.py. 2017-05-07 23:21:50 -07:00
ccache.py zephyr: Fix bogus uses of `force_bytes` that break on Python 3. 2017-08-16 17:23:57 -07:00
context_managers.py mypy: Amend flock contextmanager to accept Union[int, IO[Any]]. 2017-08-05 17:53:18 -07:00
create_user.py mypy: Allow None in passwords while creating users. 2017-05-23 21:56:50 -07:00
db.py pep8: Add compliance with rule E261 to zerver/lib/db.py. 2017-05-18 03:00:32 +05:30
debug.py mypy: Fix several Optional typing errors. 2017-02-10 23:53:44 -08:00
digest.py digest: Stop generating digest emails for soft-deactivated users. 2017-08-15 22:04:52 -07:00
domains.py Add stricter domain validation and improve error messages. 2017-01-26 17:24:25 -08:00
email_mirror.py utils: Cast generate_random_token to str. 2017-07-17 23:18:47 -07:00
emoji.py reactions: Store the emoji codepoint in the database. 2017-08-15 09:29:27 -07:00
error_notify.py Fetch system bots using new get_system_bot function. 2017-05-23 10:30:40 -07:00
events.py events: Fill in missing messages for a returing soft_deactivated user. 2017-08-15 08:33:16 -07:00
exceptions.py mypy: Annotate zerver/lib/exceptions.py. 2017-08-14 09:47:28 -07:00
export.py lib: Remove unused get_user_profile_by_email import in export.py. 2017-07-20 16:50:23 -07:00
feedback.py settings: Change all uses of ZULIP_ADMINISTRATOR to FromAddress.SUPPORT. 2017-07-05 15:33:01 -07:00
generate_test_data.py generate_test_data: Replace source with non-Gutenberg text. 2017-08-05 11:04:35 -07:00
hotspots.py hotspots.py: Add SEND_ALL flag. 2017-08-05 18:32:37 -07:00
html_diff.py message-edit: Patch html tags after edits on new lines. 2017-06-19 16:43:11 -04:00
i18n.py Fix several new errors caught by mypy 0.501. 2017-03-03 14:12:52 -08:00
initial_password.py mypy: Convert zerver/lib to use typing.Text. 2016-12-25 10:33:45 -08:00
integrations.py integrations: Add OpsGenie integration. 2017-08-15 08:42:19 -07:00
logging_util.py RateLimitFilter: Fix issues with unicode exceptions. 2017-07-07 16:51:04 -07:00
management.py management: Fix typo in get_realm CommandError message. 2017-08-08 14:13:19 -07:00
mention.py bugdown: Fully remove mentions matching @name. 2017-08-16 11:18:09 -07:00
message.py reactions: Store the emoji codepoint in the database. 2017-08-15 09:29:27 -07:00
migrate.py migrations: Add create_if_not_exist() helper. 2017-06-13 13:58:58 -07:00
mobile_auth_otp.py mobile: Add mobile one-time-pad library. 2017-04-28 11:47:35 -07:00
name_restrictions.py name_restrictions: Update with new competitors and portico pages 2017-07-26 12:10:58 -04:00
narrow.py Update narrow.py, messages.py to support is:unread. 2017-06-19 06:51:13 -04:00
notifications.py emails: Change Zulip Missed Messages to sentence case. 2017-07-25 17:42:33 -07:00
onboarding.py Replace adddressee.for_email() with for_user_profile(). 2017-08-22 10:42:15 -07:00
outgoing_webhook.py mypy: Mark request_data as Optional based on requests API. 2017-08-07 21:27:50 -07:00
parallel.py mypy: Remove superfluous older 'type: ignore' annotations. 2017-08-08 11:27:51 -07:00
profile.py decorator: Extract zerver/lib/profile.py. 2017-08-15 10:54:23 -07:00
push_notifications.py push_notifications: Fix mypy annotation logic around push tokens. 2017-07-07 10:54:37 -07:00
queue.py tornado: Move setup_tornado_rabbitmq to application.py 2017-07-21 09:55:25 +05:00
rate_limiter.py rate_limiter: Upgrade api_calls_left to generic API. 2017-08-02 18:01:39 -07:00
realm_icon.py realm_icon: Use string_id instead of domain for Realm gravitar. 2017-03-13 14:28:43 -07:00
redis_utils.py settings: Add support for specifying a remote redis password. 2016-08-11 16:54:22 -07:00
request.py request: Improve documentation of request.py. 2017-08-14 09:49:29 -07:00
request.pyi JsonableError: Move into a normally-typed file. 2017-07-24 16:41:22 -07:00
response.py errors: Eliminate redundant `json_response_to_error` calls. 2017-07-25 15:33:11 -07:00
rest.py api: Allow incoming webhook bots to use the send_message API. 2017-08-22 10:06:34 -07:00
retention.py messages: Add support for admins deleting messages. 2017-05-29 21:59:38 -07:00
send_email.py emails: Add comment explaining xor in build_email. 2017-07-17 16:05:38 -07:00
sessions.py mypy: Mark get_session_user() as returning Optional[int]. 2017-08-09 18:04:21 -07:00
soft_deactivation.py soft-deactivation: Return list of soft deactivated/reactivated users. 2017-08-15 22:05:19 -07:00
sqlalchemy_utils.py mypy: Remove a bunch of now-unnecessary type: ignore annotations. 2016-10-17 11:48:34 -07:00
statistics.py statistics: Delete a bunch of dead code. 2017-07-31 17:06:15 -07:00
str_utils.py mypy: Added Dict, List and Set imports. 2017-03-04 14:33:44 -08:00
streams.py messages: Move is_public_stream out of views code. 2017-08-15 10:06:26 -07:00
test_classes.py result.json: Upgrade test_classes. 2017-08-17 09:03:35 -07:00
test_data.source.txt generate_test_data: Replace source with non-Gutenberg text. 2017-08-05 11:04:35 -07:00
test_fixtures.py Create complex sample messages for dev VM. 2017-08-01 20:54:39 -07:00
test_helpers.py test_helpers: Add 'method' to HostRequestMock. 2017-08-15 19:47:03 -07:00
test_runner.py test_runner: Support only Django version >= 1.11. 2017-07-10 11:32:10 -07:00
tex.py mypy: Fix Optional typing issues in tex.py. 2017-03-23 15:49:08 -07:00
timeout.py pep8: Add compliance with rule E261 timeout.py. 2017-06-04 15:06:29 +05:30
timestamp.py Replace timezone.utc with timezone_utc. 2017-04-16 12:28:56 -07:00
timezone.py Add timezone field in UserProfile. 2017-03-15 11:18:24 -07:00
type_debug.py mypy: Remove superfluous older 'type: ignore' annotations. 2017-08-08 11:27:51 -07:00
unminify.py Fix browser error reporting to find webpack source map files. 2017-07-28 16:01:23 -07:00
upload.py upload: Fix uploading files with Python 3. 2017-08-16 07:33:23 -07:00
user_agent.py
users.py bots: Add UI to select Slack compatible interface for webhooks. 2017-07-28 16:22:55 -07:00
utils.py utils: Cast generate_random_token to str. 2017-07-17 23:18:47 -07:00
validator.py validators: Add check_url validator. 2017-06-15 15:03:26 -07:00