Commit Graph

4925 Commits

Author SHA1 Message Date
vaibhav 42af09663d validators: Add check_url validator.
This just uses Django's existing validator, and reformats its
interface to work with has_request_variables.
2017-06-15 15:03:26 -07:00
Tim Abbott 0904d61e96 integrations: Remove compatibility code for HTML format docs.
This fixes a coverage error in Travis CI caused by this code no longer
being used.
2017-06-15 12:34:46 -07:00
Rohitt Vashishtha c802967808 webhooks/travis: Fix typos in docs. 2017-06-15 11:11:56 -07:00
Rohitt Vashishtha d671dea29f webhooks/yo: Migrate docs to markdown. 2017-06-15 11:10:44 -07:00
Rohitt Vashishtha 1fe58eb325 webhooks/slack: Migrate docs to markdown. 2017-06-15 11:10:44 -07:00
Tim Abbott 93ea4128ac auth: Require the realm_name field in RegistrationForm.
Previously, the only required field in RegistrationForm was the full
name (and possibly ToS, depending on settings).  This meant that if
LDAP was configured, realm creation would break, because the form
would be valid the first time one landed on it, before the user even
filled it out!

The correct fix is to make the extra fields required in
RegistrationForm in the event that we're doing realm creation.

It's possible that a cleaner fix would be to use a subclass.

With a test from Umair Waheed Khan.

Fixes #5387.
2017-06-15 11:04:25 -07:00
Tim Abbott 57d26c1a66 auth: Add realm_creation parameter to RegistrationForm. 2017-06-15 11:04:25 -07:00
Umair Khan 2e1ccabb88 forms.py: Add the dynamic field in __init__
If we add the field like this, we can control its existence in tests.
In other case, since classes are compiled once, even if we set
TERMS_OF_SERVICE to False in tests, terms field would still continue
to exist in the form class.
2017-06-15 10:14:55 -07:00
Abhijeet Kaur af7e08acb0 bots: Add UI to view bot types of existing bots in "Your bots".
Tweaked by tabbott for more standard internationalization.
2017-06-15 10:08:31 -07:00
kunall17 d8310724b6 Use absolute URLs in GCM push notifications.
This will eventually allow us to simplify the logic required for the
mobile apps processing GCM notifications.
2017-06-15 03:56:59 -07:00
Harshit Bansal 7950f82f27 realm_emoji: Make sure that a deactivated realm emoji can't be used.
A deactivated realm emoji should neither be accepted further as a
reaction nor its further occurences in a message be rendered as an
emoji. However, all the old occurences should continue to render
normally.
2017-06-15 02:59:57 -07:00
Harshit Bansal 8db2cf8d7c models.py: Add `deactivated` field to the emoji dicts.
Add `deactivated` field to the realm emoji dicts returned from the
`get_realm_emojis_uncached()` function.
2017-06-15 02:59:57 -07:00
Harshit Bansal e85c11a461 models: Add `deactivated` field to RealmEmoji model.
Instead of deleting the emojis we will just mark them as `deactivated`.
This will prevent their further use but at the same time they will be
displayed properly in the reactions and messages in which they are used.
This field will be used as a flag to indicate whether the realm emoji
has been deleted or not.

Includes a database migration.
2017-06-15 02:59:57 -07:00
Tim Abbott 1043cd7a2b docs: Fix tests for error pages.
Without the trailing /, these return a 30x error.
2017-06-14 21:21:36 -07:00
Cory Lynch 78de70688e dev: Add URL to preview error 404/5xx pages. 2017-06-14 21:18:45 -07:00
Cory Lynch cb4dadfdcd tools: Create /devtools page for useful dev URLs.
Fixes #5179.
2017-06-14 20:17:56 -07:00
Eeshan Garg 2344e26b1a webhooks/zendesk: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
Eeshan Garg 9e77749bfc webhooks/wordpress: Migrate docs to Markdown.
Markdown doesn't support tables, so I used an unordered list
instead for the HTML table at the end.
2017-06-14 17:42:17 -07:00
Eeshan Garg 4a3137be97 webhooks/taiga: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
Eeshan Garg 1c5d0bb0fa webhooks/semaphore: Use append-stream-name.md macro. 2017-06-14 17:42:17 -07:00
Eeshan Garg 0d611d4c8a webhooks/stripe: Migrate docs to Markdown. 2017-06-14 17:42:17 -07:00
Harshit Bansal 0e25634934 views/alert_words.py: Use `do_add_alert_words()` in `add_alert_words()`.
Revert to the use of `do_add_alert_words()` in `add_alert_words()`
instead of `do_set_alert_words()` since it is used for serving a
PUT request. This change seems to be mistakenly done in commit
`d564a76f8e45b24cd2c66475ef7693582fb2f5fc'.
2017-06-13 16:36:11 -07:00
Aditya Bansal 914ab1040d integrations/codebase.html: Migrate to Markdown. 2017-06-13 16:32:00 -07:00
Eeshan Garg f1c209b38d lib/integrations: Stop passing kwargs as positional args to super. 2017-06-13 15:33:22 -07:00
Eeshan Garg b741f45408 webhooks/splunk: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg df28bb40f2 webhooks/sentry: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg 84da473da5 webhooks/semaphore: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg d5fa02c7da webhooks/pingdom: Migrate docs to Markdown. 2017-06-13 15:33:22 -07:00
Eeshan Garg 0b1296ed83 webhooks/librato: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg ac1ddc4dc8 webhooks/jira: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg 571130e2fe webhooks/homeassistant: Migrate docs to Markdown. 2017-06-13 15:33:21 -07:00
Eeshan Garg cfa0f5332a webhooks/freshdesk: Migrate docs to Markdown. 2017-06-13 15:30:35 -07:00
Eeshan Garg 902ae31e15 webhooks/deskdotcom: Migrate docs to Markdown. 2017-06-13 15:30:35 -07:00
Eeshan Garg 32550159de github_webhook: Use Integration.stream_name as recommended stream. 2017-06-13 15:30:35 -07:00
Eeshan Garg c3c004743c github/doc.md: Use Integration.stream_name as default stream. 2017-06-13 15:30:35 -07:00
Eeshan Garg 9cefdb9ed2 bitbucket/doc.md: Use Integration.stream_name as default stream. 2017-06-13 15:30:35 -07:00
Eeshan Garg db09913f38 lib/integrations: Add stream_name attribute to Integration.
Instead of using the name of the integration as a recommended
stream name in its documentation, the Integration object now
has a dedicated attribute stream_name to explicitly specify a
recommended stream name for when it is different than the name
of the integration itself.
2017-06-13 15:30:35 -07:00
Umair Khan b74cc576ae Django 1.11: Make makemessages command compatible.
Now REs have moved to template module. This commit adds a condition
to use trans_real module if the Django version is less than 1.11 else
use template module.
2017-06-13 15:14:05 -07:00
Umair Khan aeb68a6643 zerver: Add on_delete arg in foreign keys.
on_delete will be a required arg for ForeignKey in Django 2.0. Set it
to models.CASCADE on models and in existing migrations if you want to
maintain the current default behavior.
See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete
2017-06-13 15:13:45 -07:00
Umair Khan 8660e002bb Django 1.11: Upgrade parallel test runner.
In Django 1.11, args argument of run_subsuite function is a tuple of
length 4. The new argument is the test runner class which we do not
need because we run tests using our own version of the test runner.
2017-06-13 15:04:04 -07:00
Umair Khan 399973167c testing: Add testing framework for Tornado. 2017-06-13 15:04:04 -07:00
Umair Khan 95fc16d90d Django 1.11: MIDDLEWARE_CLASSES setting is deprecated.
Django provides MiddlewareMixin to upgrade old-style middlewares. See
https://docs.djangoproject.com/en/1.11/topics/http/middleware/#upgrading-middleware
2017-06-13 15:04:04 -07:00
Umair Khan 1e9c87855c Django 1.11: is_authenticated is now a property. 2017-06-13 15:04:04 -07:00
Steve Howell c96d58734f migrations: Index mentioned messages.
This index is basically free, since it only consumes space for
messages that mention the user, but results in a massive performance
improvement when querying messages that mention a user.
2017-06-13 13:58:58 -07:00
Steve Howell 52f7d1a3e2 migrations: Index starred messages.
This index is essentially free, since it only consumes resources for
starred messages, and massively improves the performance of the
"starred messages" narrow.
2017-06-13 13:58:58 -07:00
Steve Howell b5ebdc7926 migrations: Add create_if_not_exist() helper.
This replaces a function that was on longer in use.  We need
this helper for our old version of postgres.
2017-06-13 13:58:58 -07:00
Rishi Gupta dbac262509 hotspots: Change hotspots to have a name and a description. 2017-06-13 12:59:33 -07:00
Aditya Ramesh a77aa79da9 emails: Add html versions of emails that do not have them.
Fixes #4691.
2017-06-12 23:02:28 -07:00
Rishi Gupta 1f77a0cdee confirmation: Remove Confirmation.objects.send_confirmation.
I think it makes sense to wrest the email sending from confirmation, now
that we have a clean email-sending interface in send_email. A few other
reasons:
* send_confirmation is get_link_for_object followed by send_email, but those
  two functions have no arguments in common.
* Sending email through confirmation obfuscates the context dict, and is a
  relatively complicated piece of the codebase anyone trying to deal with
  the email system has to understand.
* The three emails previously being sent through confirmation don't have
  that much in common, other than that they happen to have a confirmation
  link in them.

The .split('/')[-1] in registration.py is a hack, but a hack used several
places in the codebase, so maybe one day get_link_for_object will also
return the confirmation_key.
2017-06-12 23:02:28 -07:00
Rishi Gupta e4d3ce953b registration.py: Refactor send_registration_completion_email.
We're about to make a change where we no longer deal with confirmation
objects in these email pathways.

The "if settings.DEVELOPMENT and realm_creation" is a bit of a hack, but no
worse a hack as was there before, I think. I think it's also less confusing
if the method signature matches what happens in production.
2017-06-12 23:02:28 -07:00