Commit graph

13 commits

Author SHA1 Message Date
Steve Kowalik
866217bf35 Switch score calculation to pure Python
Rip out the score expression madness, and calculate the score in Python,
since I hear that Python is better at math than SQL is.
2017-08-08 16:41:02 +10:00
Sachi King
084c78e2cd Fix score calculation hack
I have no idea why we do this in the database as some magic after we
call save().  I also have no idea why MySQL is seeming to think we want
type BIGINT UNSIGNED at the end of the
((2 * '+2' + '+1') - ( '-1' + 2 * '-2')) but it does.

Setting it to 2.0 or float(2) doesn't get the ORM to get this right, but
we are going to Decimal and making the 2 multiplier be of type Decimal
manages to make the ORM pull it's shit together and use something that
seems like we're okay with.

+1, -2 = 1 / 2 = -0.5 Score == True
Looks like it works.

UPDATE `symposion_reviews_proposalresult` SET `score` = CASE WHEN `symposion_reviews_proposalresult`.`vote_count` = 0 THEN '0' ELSE ((((2 * `symposion_reviews_proposalresult`.`plus_two`) + `symposion_reviews_proposalresult`.`plus_one`) - (`symposion_reviews_proposalresult`.`minus_one` + (2 * `symposion_reviews_proposalresult`.`minus_two`))) / (`symposion_reviews_proposalresult`.`vote_count` * 1)) END WHERE `symposion_reviews_proposalresult`.`id` = 1
2017-08-08 15:37:33 +10:00
Sachi King
e1ce26eb62 Cleanup more user exploitable input with bleach
My eyes hurt.  More user exploitable XSS on inputs.
2017-08-07 20:13:10 +10:00
James Polley
bba5649360 Travel assistance to sydney please
* Tweaks help_text to indicate that travel assistance is to Sydney
* Includes the required migration

This migration doesn't change the DB so it's safe to apply with the system live.
2017-07-31 22:48:49 +10:00
Bruce Crawley
56dc089d59 Merge branch 'review-order' into 'master'
Order by ID rather than at last update time

See merge request !16
2017-07-16 00:43:39 +00:00
Sachi King
5b4e1ec01d Revert "Removes speaker assistance options from the profile form."
This reverts commit 2aa0074bdc.
2017-07-16 00:21:10 +10:00
Sachi King
89e74a6f11 Order by ID rather than at last update time
The current ordering is based on what appears to be a random ordering
that happens to correlate to the last time the paper was submitted or
updated.  Oldest to most recent.

This changes it to submission order so ordering doesn't change and ID is
a static, making it easier to move through a list of papers.  "I last
looked at 24, so 25 is assured to be the next one I want to look at.

There's the thought of updated papers being looked at and voted on, but
it does not seem to me that this is supported or possible.  In general
one would look at their un-reviewed list, and go off it, which puts
updates out the window.

We can certainly order on other fields if desired, but this one makes
the most since to me.
2017-07-14 21:19:28 +10:00
Sachi King
31375f9e91 Remove default name from create_review_permssions
This was removed somewhere in 1.8, which means this results in a
failure.  If I understand correctly, this "name" is now derived from the
model name's __str__ or something like that.
2017-07-07 00:16:08 +10:00
Jamie Lennox
59207eb0c9 Other suggested django migrations
So django keeps strict synchronization between its code and migrations
so that it can help generating new migrations. These are the additional
suggested migrations. A lot of these are a null effect, some are things
like transforming an unsigned integer to a signed integer. So not super
urgent on a small scale, but worth doing to keep django happy.
2017-07-02 22:38:38 +10:00
Jamie Lennox
274f8ac966 Add the T&C and COC to the accept box
Link to the T&C and Code of conducts so people know what they are
accepting. Create this as a static link because i don't know how django
would accept this being something dynamic on the model.

This annoyingly creates a migration, but it's not a real change and
easier to accept it now than fight django forever.
2017-07-02 16:08:15 +10:00
Sachi King
4c5da0fee6 Vendor registripe 2017-05-27 21:08:17 +10:00
Sachi King
c1abf4717d Vendor registration 2017-05-27 20:59:35 +10:00
Sachi King
d95d66dac8 Taking one out of PyCon's (US) book
We're lock-step with symposion, and upstream is dead.
Vendor it.
2017-05-27 20:11:39 +10:00