Commit Graph

4582 Commits

Author SHA1 Message Date
Cory Lynch b1bfe9f42e Add migration to force lowercase existing realm emoji.
Since realm emoji are now required to be lowercase,
an appropriate migration was added to retroactively
fix any emoji that might have contained uppercase
letters.

Also, the validator on the model was changed to
reject uppercase letters.
2017-05-11 19:10:21 -07:00
Cory Lynch 68e5898a07 emoji.py: Add restriction that realm emoji must be lowercase.
Raises error if emoji name has an uppercase letter in it.
2017-05-11 19:10:21 -07:00
Tim Abbott 6eada74bfe portico: Fix exception if no realm description is set.
This was caught via Casper tests, which I regret not running.
2017-05-11 14:23:46 -07:00
Tim Abbott 223624be25 settings: Add support for longer, markdown-powered realm descriptions.
This makes it possible to create much prettier login pages.

Further work on styling may be necessary.
2017-05-11 13:59:46 -07:00
Umair Khan 329b377e6a push_notification: Add uses_notification_bouncer().
This function abstracts the logic to ascertain if we are using
notification bouncer service or not. Makes our code more
maintainable.
2017-05-11 12:04:16 -07:00
Umair Khan 112a67097b push_notifications: Don't get alert message.
Now we set the alert message in the payload functions for both GCM and APNs so
no need to get it here.
2017-05-11 12:04:16 -07:00
Umair Khan 3c32bc6d8a push_notification: Create get_gcm_payload. 2017-05-11 12:04:16 -07:00
Umair Khan d90774b9db push_notifications: Create get_apns_payload.
This function creates the payload that we will send to APNs.
2017-05-11 12:04:16 -07:00
Umair Khan 5ff7fdf83a push_notification: Create get_alert_from_message.
This function returns the alert shown by iOS or Android device.
2017-05-11 12:04:16 -07:00
Umair Khan 10ed47156d api_auth: Use is_remote_server. 2017-05-11 12:02:26 -07:00
Umair Khan faf190ff34 validate_api_key: Use is_remote_server. 2017-05-11 12:02:26 -07:00
Umair Khan 252fa53816 api: Add is_remote_server().
This function abstracts the logic to ascertain the source of API
auth request.
2017-05-11 12:02:26 -07:00
Umair Khan dc2a9a4c5b github: Add sign up button on registration page. 2017-05-10 17:49:08 -07:00
Umair Khan d56db0a3b4 auth.py: Add confirmation handlers for signup.
These handlers will kick into action when is_signup is False. In case
the account exists, the user will be logged in, otherwise, user will
be asked if they want to proceed to registration.
2017-05-10 17:20:34 -07:00
Umair Khan 11426a2cec log_into_subdomain: User should be None in signup. 2017-05-10 17:20:34 -07:00
Tim Abbott 5019b53492 auth: Pass is_signup option around. 2017-05-10 17:20:34 -07:00
Tim Abbott ce3974b40e auth: add is_signup option to login_or_register_remote_user. 2017-05-10 17:20:34 -07:00
Tim Abbott e8eaec0a18 mypy: Fix various errors caught by removing cache_with_key. 2017-05-10 14:37:20 -07:00
Tim Abbott e55b4b0d43 invites: Fix buggy access to non-existant user_profile.name. 2017-05-10 14:31:24 -07:00
Tim Abbott a85c066722 confirmation: Fix race with invite and email change. 2017-05-10 14:31:24 -07:00
Tim Abbott a0a50d410c test_docs: Add tests to ensure all integrations present. 2017-05-10 11:30:32 -07:00
Tim Abbott a3ddd94aa3 integrations: Remove unnecessary email_integration_enabled.
Previously, we were ending up with 2 copies of the email integration
in there.
2017-05-10 11:24:25 -07:00
Tim Abbott 248785e66e integrations: Fix missing links to non-webhook integrations.
Apparently help_content was attached to the wrong class.

Fixes #4744.
2017-05-10 11:17:56 -07:00
Tim Abbott 232592cc9f test_sessions: Extends tests to reach 100% coverage of sessions.py.
Fixes #3980.
2017-05-10 10:12:21 -07:00
andrewallen00 53f1f75fcb Add tests for zerver/lib/sessions.py. 2017-05-10 10:12:14 -07:00
Tim Abbott 0e05f3f4ee emails: Remove pre-email-migration scheduled jobs.
This fixes an issue introduced when we migrated the format of all of
our emails, which caused any old ScheduledJob rows to be corrupted.
2017-05-10 09:45:40 -07:00
Tim Abbott 9f7236eec1 message: Remove unused old gravatar_hash field from message dicts.
This was deprecated and replaced some 4 years ago.
2017-05-09 22:33:27 -07:00
Tim Abbott e3505bd5ae avatar: Fix memcached query loop fetching messages.
This fixes a major performance issue, where we would fetch
user_profile objects inside a code path that had already bulk-fetched
the necessary user objects.

Like the similar related changes we just made, the fix is to marshall
and pass the data into the avatar library directly.
2017-05-09 22:33:27 -07:00
Tim Abbott 0990246289 avatar: Fix memcached query loop fetching bots.
Similar to the related issue with users, the new avatar storage had
accidentally added database queries in a loop to this code path.
2017-05-09 22:33:27 -07:00
Tim Abbott 8e47dc73bd avatar: Fix loop doing database queries in register.
Due to the refactoring of the avatar URL codepath that added realm IDs
to the URLs, we ended up calling `get_user_profile_by_email` inside
`get_avatar_url`, which in turns was called in a loop over all users
in a realm.

Needless to say, this resulted in a significant performance problem.

We fix this issue by passing in the data needed to compute the avatar
URL, rather than looking it up by email address.
2017-05-09 22:33:27 -07:00
Tim Abbott 676d4f32fc avatar_url: Fix unnecessary database query.
If we have a user_profile object, there's no reason to fetch it again
from memcached.
2017-05-09 22:33:27 -07:00
Tim Abbott c8b0ac0a05 avatar_hash: Extract user_avatar_path_from_ids. 2017-05-09 22:31:24 -07:00
Tim Abbott bd3e338c35 templates: Fix URL coverage for new files. 2017-05-09 18:42:24 -07:00
Tim Abbott fc24a56fc5 test_docs: Fix expected text in /hello page. 2017-05-09 17:23:38 -07:00
Tim Abbott df6dba9673 test_home: Fix expected text in /hello page. 2017-05-09 16:59:33 -07:00
Tim Abbott 2d97db3518 streams: Add endpoint for modifying properties of a single stream.
This is likely to be the more common endpoint for API clients like the
mobile apps to interact with when modifying streams.
2017-05-09 13:42:34 -07:00
kunall17 e087bc24f8 streams: Migrate stream property changes to new REST endpoint.
This is one of the last major endpoints that were still done in the
pre-REST style.

While we're at it, we change the endpoint to expect a stream ID, not a
stream name.
2017-05-09 13:39:23 -07:00
Rohitt Vashishtha 0414ac6df5 bugdown: Convert GitHub image-preview urls to image urls.
This makes inline image previews work for links to image files' pages
on GitHub.

Fixes #4658.
2017-05-09 11:22:37 -07:00
Umair Khan 4971b7ff9f testing: Add errored tests to failed tests list.
Fixes: #4716.
2017-05-09 09:36:59 -07:00
Steve Howell b609911656 Remove unused get_user_profile_by_email() imports. 2017-05-08 11:57:38 -07:00
Steve Howell 3b2a3601c1 tests: Add ZulipTestCase.notification_bot(). 2017-05-08 11:57:38 -07:00
Steve Howell 3a031f6814 test: Use example_user() in more places.
This commit replaces calls to get_user_profile_by_email() with
calls to self.example_user() by introducing a local variable.
2017-05-08 11:57:38 -07:00
Steve Howell 7f9057ba99 tests: Use example_user() in more places. 2017-05-08 11:57:38 -07:00
Steve Howell 6bc8424c71 Use self.example_user() in more places.
This fixes most cases where we were assigning a user to
the var email and then calling get_user_profile_by_email with
that var.

(This was fixed mostly with a script.)
2017-05-08 11:57:38 -07:00
Steve Howell 942db9b6c5 tests: Added ZulipTestCase.example_user() function.
The example_user() function is specifically designed for
AARON, hamlet, cordelia, and friends, and it allows a concise
way of using their built-in user profiles. Eventually, the
widespread use of example_user() should help us with refactorings
such as moving the tests users out of the "zulip.com" realm
and deprecating get_user_profile_by_email.
2017-05-08 11:57:38 -07:00
Aditya Bansal 3a097a2a6c pep8: Add compliance with rule E261 to semaphore/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal bf24e0c9db pep8: Add compliance with rule E261 to stripe/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal 3791638985 pep8: Add compliance with rule E261 to semaphore/tests.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal 21dd1384b4 pep8: Add compliance with rule E261 to pivotal/view.py. 2017-05-07 23:21:50 -07:00
Aditya Bansal 43c978e0f4 pep8: Add compliance with rule E261 to pagerduty/view.py. 2017-05-07 23:21:50 -07:00