Commit Graph

138 Commits

Author SHA1 Message Date
Luke Faraone 0c47459733 Also escape &s.
(imported from commit 8a76089492b0e7f7ff2635e7091485db2d7292c4)
2012-10-02 15:11:55 -04:00
Jessica McKellar 8727b1667c Check if a class name is valid when checking for existence.
(imported from commit f4de50b52c851058b736033d447ea7fa6777a3d4)
2012-10-01 15:36:10 -04:00
Luke Faraone aca5cef3eb Redirect to login when attempting to resignup with a used email address.
(imported from commit d58a5dda9a0af409a6ee57cfcd30be45020352d2)
2012-10-01 10:45:58 -04:00
Luke Faraone 50dfbf7a1b Implement confirmation for new user signups.
We add a few templates for django-confirmation. We define a
"PreregistrationForm" which is validated by accounts_home, which then
generates a confirmation object and emails the user. This required creating
a new table for a PreregistrationUser with an email and status (confirmed)
field.

The register function now no longer accepts a "email" field in the form
and deals only with confirmation IDs to determine the email used to sign
up a user.

(imported from commit 4fcde04530aa7ad4de84579668daee7290b424ac)
2012-10-01 10:45:58 -04:00
Keegan McAllister 5556bdd0a1 Put the type conversions back into return_messages_immediately
This had broken the check 'if last == -1'

(imported from commit 2154dbda696d72ea14c841f43511846a87e4ba0d)
2012-10-01 10:14:47 -04:00
Tim Abbott 85da33c4ee Fix return_messages_immediately.
If the relevant keys don't exist, Django returns a
MultiValueDictKeyError, which wasn't one of the ones we had exceptions
for.  This was breaking the API.

(imported from commit 1c1394006afcbdbee9465ad8c8c667ed5de5a346)
2012-09-28 21:08:39 -04:00
Keegan McAllister 25eeaabe47 On load, send a range around the pointer, then fill in later, then earlier
This still doesn't handle collapsing entirely correctly for the backfilled
messages.

(imported from commit d1fa3e2249968208e735454c27b8cab20bb78d3f)
2012-09-28 19:40:45 -04:00
Keegan McAllister c65a387c1e Factor out the determination of which messages to send immediately
(imported from commit 31c688986e4d8f923913083f36dea9c79a4c36ce)
2012-09-28 18:37:12 -04:00
Keegan McAllister a8ec5c533f Move the code for new messages immediately available into views.py
(imported from commit 4cfa0ead850b1a37a21ec7945b477e12681c5830)
2012-09-28 18:37:12 -04:00
Keegan McAllister 946c901e05 Factor the formatting of the updates response out of get_updates_backend
(imported from commit eb6a09363d671630afa7dea4ff23518c2a90fb97)
2012-09-28 18:37:12 -04:00
Keegan McAllister e9f70c1efb Track the first received message
We don't use this information, yet.

(imported from commit 24a9466823f3e7a287027969d3841c7638954e76)
2012-09-28 18:37:11 -04:00
Tim Abbott 8b87ba04ef Fix apply_markdown option in new get_updates_api function.
(imported from commit 971010fff6408d691c5942c5a651c58413c2c091)
2012-09-27 17:39:28 -04:00
Tim Abbott ccee128d61 New prototype zephyr mirroring system with bidirectional support.
(imported from commit cfb95ae8d0a241e7c068106e561dc18e16461596)
2012-09-27 17:33:21 -04:00
Tim Abbott f7b8d371cd Make the last_received parameter optional.
(imported from commit 001806356286cac85f79f521a48c09686d6f6bb6)
2012-09-27 16:42:15 -04:00
Keegan McAllister 3429e77178 Don't display the "Loading..." indicator if the user has no messages
(imported from commit a050218ccde3b82c570a9373cbab5e3fb22abcde)
2012-09-27 16:15:10 -04:00
Keegan McAllister 4e846f9059 Change the home page back to the register form, but go to login on log out.
This reverts commit 5c21c3b44ebc69377177ceb50b43dfd560f0b4d1.

(imported from commit ef983386ee11cbe3a75a7f0555f81ac71240c4c0)
2012-09-27 15:54:33 -04:00
Keegan McAllister 20240d869c Rename get_updates_longpoll to get_updates
(imported from commit 15635904584b324bdfa1414caea12c3bc4ce54c8)
2012-09-27 15:46:36 -04:00
Tim Abbott 1a5c18b12c Redirect not logged in users to the login page, not the signup page.
(imported from commit 5c21c3b44ebc69377177ceb50b43dfd560f0b4d1)
2012-09-27 15:01:30 -04:00
Tim Abbott 6394a54db7 Clean up the forge_zephyr workflow.
(imported from commit c559cfde267bc537cf554705a9750dcfe76f88ce)
2012-09-27 15:01:30 -04:00
Tim Abbott 8ffd91a6ee Move new user/class creation into their own functions.
(imported from commit 192533c4e2bc55a26e7ea70a32e7d1f64d2ed8c3)
2012-09-27 15:01:30 -04:00
Luke Faraone 94fbb8b6c1 Remove references to HASH_SALT / MD5_SALT in the settings page.
(imported from commit a474454ce5aa8d11a6a0bcc0f0828b54f5dea81f)
2012-09-26 17:36:25 -04:00
Keegan McAllister 21d76b3398 Don't send instance_list in index.html
It gets populated from the zephyrs we receive in the initial get_updates_longpoll.

(imported from commit 83c773d211ea323233a986ccf12fd797236c08a5)
2012-09-26 17:11:00 -04:00
Keegan McAllister 12e458df80 Get initial messages from get_updates_longpoll
(imported from commit 2bb9c51409735abe23bad758338b13121aea4c99)
2012-09-26 17:10:59 -04:00
Luke Faraone 05e64f904d Use .cleaned_data rather than sanitising identifiers twice.
(imported from commit c691e010f94e623706167a91ccfd505fae02f609)
2012-09-26 16:42:10 -04:00
Luke Faraone ae6cfee818 Implement a new login redesign per Waseem. Be a little cute about it.
Split off some content previously placed into base back into index.html.
Move content previously localised in accounts_home to a new content_base
for use in the non-app version of the site.

We wrote up some copy and styled it according to taste.

In our new signup form, we no longer collect a short name and instead
extrapolate from the email.

(imported from commit cd734b13a4bda7f304129379524c4cc96b77b24b)
2012-09-26 16:42:10 -04:00
Tim Abbott c8220ee057 Don't store the post-markdown HTML in our database content column.
(imported from commit bb81e84acc04ea0930be1026149618fbb60174fd)
2012-09-26 14:51:14 -04:00
Tim Abbott f929593263 Don't try to use in-memory storage on model objects.
It doesn't work.

(imported from commit d5f95c345061e63b12fa12f2a0219f8e3b2e0380)
2012-09-26 10:44:47 -04:00
Keegan McAllister 4b19511423 Fetch instance list using a join rather than querying every recipient
(imported from commit d2de941083485f11ea8222451fb32bafe42987f6)
2012-09-25 19:26:06 -04:00
Keegan McAllister c123b5225e Fetch Zephyrs from UserMessage using a join rather than one by one
Cuts about 4 seconds of load time on the current live site.

(imported from commit 805a9444b7685fef259923b208ad734276a05de3)
2012-09-25 19:21:30 -04:00
Keegan McAllister 9efb63f6b8 Display SQL queries when DEBUG = True and URL like /?show_debug=y
(imported from commit dc3efd7aee2975f7d007296ba1ee1f72b262c493)
2012-09-25 18:40:59 -04:00
Tim Abbott 3b817ecc1c Actually fix deduplication of synced huddle messages.
(imported from commit 63e7fbdc89e1271751f73d20f2185a048b56dd60)
2012-09-24 17:38:21 -04:00
Tim Abbott a3a027f8c7 Another attempt at fixing huddle message deduplication.
(imported from commit 3b0a06d7bee7eacbe4eeb8ff6095bdcd5ce17e95)
2012-09-24 16:34:29 -04:00
Tim Abbott 0be4ce05a6 Another attempt at fixing huddle message deduplication.
(imported from commit 6d48a3488b5ca0b3fc923386d5edfdd8c002112d)
2012-09-24 16:33:50 -04:00
Tim Abbott 1f6e09834b Another attempt at fixing huddle message deduplication.
(imported from commit 9b271d8bcb4ad902aaf2f21b73fc8536840262df)
2012-09-24 16:33:24 -04:00
Tim Abbott 2a1503fd35 Hopefully fix huddle message deduplication with MIT sync.
(imported from commit bccaa67d02e72b1c444d39b019d5bd87800b1441)
2012-09-24 16:30:24 -04:00
Tim Abbott 11e5e8785d Preparation for syncing messages back to MIT.
(imported from commit 551b697366702de93579de259a9bc644be8d66ec)
2012-09-24 14:31:40 -04:00
Waseem Daher d3bb97a21f Raise error when subscribing to an already-subscribed-to class.
(imported from commit bc946fb99e6982d37fe8403b9ade803c49b30687)
2012-09-21 17:47:58 -04:00
Waseem Daher f1aa17cf1d Change some URLs associated with subscriptions.
Put all the 'API'-ish URLs in the /json/ namespace so that
/subscriptions and /subscriptions/add, etc. can be real
user-facing URLs if we want them to be.

(imported from commit 1455a32d27e44547ab1874b6289243cb40c85dde)
2012-09-21 17:36:29 -04:00
Tim Abbott 862ade7578 Use the real timestamps when syncing forged zephyrs.
(imported from commit e25e4c2656c6f442384c08934be68753f7ee7cb0)
2012-09-21 17:23:15 -04:00
Tim Abbott 1c03419cbf If other huddle recipients don't exist, make them.
(imported from commit 5b9d8faf67657dd2ecca117aef136bc2a03f4abf)
2012-09-21 17:19:58 -04:00
Waseem Daher 230e725446 Allow spaces in classnames.
(imported from commit 9ef71240ee5e6e0ed9ca0b50d9461b539538b437)
2012-09-21 17:09:46 -04:00
Tim Abbott f960c21931 zephyr-mirror: Add support for syncing huddles.
(imported from commit 0709ca40c5510ed9dbf28c666cff96609e8d41c2)
2012-09-21 16:44:26 -04:00
Waseem Daher 5a164f19c2 Clean up subscription functions.
Now that 'manage_subscriptions' only removes subscriptions,
let's name it that. Also, since both functions now only
act on one subscription at a time, use them in the singular.

(imported from commit 52cfc7b36eb1533da7aec1bc3a6e460151a56da8)
2012-09-21 16:30:29 -04:00
Waseem Daher a27edbce7d Restyle subscriptions page.
(imported from commit 41339c5af38ae5ea4801fc1e23b7184c277145f3)
2012-09-21 16:04:44 -04:00
Tim Abbott 8be02ce8a3 Fix use of userprofile for user_profile variable in subs code.
All of our other views code uses "user_profile" as the local variable
referring to a user_profile object -- best to be consistent about
that.  We should also consider renaming Subscription model element.

(imported from commit 770cfad8258f016aef8c78c428e4499f5b12f300)
2012-09-21 14:47:40 -04:00
Tim Abbott ed46a453ba Add (mostly unstyled) settings page.
(imported from commit 492c5f498c2fec452e6c724555bc4a5a2c4c151a)
2012-09-21 14:47:26 -04:00
Keegan McAllister 85abb3f274 forge_zephyr: Convert email to lowercase
This fixes failing User.object.get(email=...)

(imported from commit e0d5097520c6a149031e6881ae25f4c5bb967918)
2012-09-21 14:11:34 -04:00
Keegan McAllister a68a3e7ab7 Get the just-created user from create_user
(imported from commit d709c99cc670aa1b0864c40b8c0d5e52b6c90340)
2012-09-21 14:01:43 -04:00
Keegan McAllister 0638c2aada forge_zephyr: fetch the just-created user
(imported from commit a269f30736f1873e6e4ed7202fcaa16c436299a8)
2012-09-21 13:56:20 -04:00
Keegan McAllister 3cbc56a866 Rename MD5_SALT to HASH_SALT
(imported from commit 3112cd805614c3057a9eb8f1b251381f48ab3173)
2012-09-21 13:44:09 -04:00