Commit graph

210 commits

Author SHA1 Message Date
Sachi King
5511a3d00a str values before bleach
Can't operate on objects, stringing seems fine here, there's a lot else
already randomly str() before bleach.
2017-12-23 04:16:36 +00:00
James Polley
2e07fbeac5 Remove unicode warning
We now support more unicodes so remove the warning
2017-12-23 12:56:33 +11:00
James Polley
3ac31dd55b Include templates in sdist
Adds a MANIFEST.in to ensure that templates are included in the built
package and thus available in systems that install this package.
2017-12-23 12:29:37 +11:00
James Polley
fcfdb10ede Display Condition type in list views
* Whether a Flag is disable-if-false or enable-if-true is a very
  important detail
* But one that's easy to get wrong
* And it's hard to spot problems without inspecting every single flag

This change adds the Condition into the various admin list views, so
that it's easier to scan them all for problems and look for inconsistencies.
2017-12-22 18:43:02 +11:00
James Polley
a880bc27fb Enhance track admin 2017-12-03 18:11:39 +11:00
James Polley
3239bbe29a Don't duplicate existing rooms when importing schedule CSV
* Old implementation needs to see exactly the same rooms in exactly
  the same order every time it loads new data, otherwise it will
  create a duplicate entry for the room that differs only in display
  order.
* New implementation ignores the display order when checking to see
  if the room already exists.
2017-12-03 16:15:19 +11:00
James Polley
6bf3d71bff Require login for proposal submit
- This has the effect of bouncing people to the login page if they're
  unauthenticated, rather than returning a 502 because 'home' doesn't
  exist.

- If they're authenticated but don't have a speaker profile, send them
  to the speaker profile create page rather than just to the
  dashboard.

Closes #26
2017-10-16 15:07:36 +11:00
James Polley
1eb28f2c80 Enhance Schedule list display 2017-10-15 15:58:43 +10:00
James Polley
fab25ad0f5 Room needs dunder-str as well as dunder-unicode 2017-10-15 15:33:56 +10:00
James Polley
e48c8c171a Display (editably) the exclusvity of the slot in the admin
(Also add filtering so that we can easily find eg all plenaries which
are not yet flagged as exclusive)
2017-10-15 15:14:55 +10:00
James Polley
6b17e021ca Add a __unicode__ method to the Room model
Closes #25
2017-10-15 15:07:56 +10:00
James Polley
b154d90eed Wrap input CSV in an TextIOWrapper
Closes #24
2017-10-15 14:59:57 +10:00
James Polley
cd4c640c1b Allow filter of team memberships by state 2017-10-14 14:31:57 +11:00
James Polley
9bf90b411e Enhance admin interface for result notifications 2017-10-13 13:02:44 +11:00
James Polley
f0933d897d Add notes to profile form about being able to edit form
Also about the known issue with some emoji
2017-10-08 15:10:34 +11:00
James Polley
45512e815a Add datatables tools to ticket reports 2017-10-04 20:43:00 +11:00
James Polley
0103f9a91f Remove erroneous debug logging statements 2017-10-01 23:11:00 +11:00
James Polley
362ed28be2 Alter guided_registrasion logic to handle new page
This is required for the new method of accepting terms and conditions
2017-10-01 22:56:19 +11:00
James Polley
287d412ccf Catch TypeErrors from bleach 2017-09-30 22:50:13 +10:00
James Polley
e51ad76384 Add a "Back" button to the guided_registration stages
"Next" is green, indicating that it's the default path, the way
forward. "Back" is available but blue.

For extra consistency, the initial "Get ticket" button is now also a btn-success
2017-09-30 18:45:57 +10:00
James Polley
4605ee0d98 Require attendees to agree to Code of Conduct 2017-09-30 18:45:50 +10:00
James Polley
35b75b6f96 Badger should fail gracefully if auth_groups hasn't been populated
Let's say you've just installed symposion for the first time, and
you're running the intial `./manage.py migrate`

In that circumstance, there isn't an auth_group table. Naturally this
means you get Some Errors when trying to look for a particular group.

This change handles that error and drives on.
2017-09-30 11:01:39 +10:00
James Polley
4e183317d0 Add requirement for lxml 2017-09-30 11:01:23 +10:00
James Polley
359640cfa1 Remove extraneous imports 2017-09-30 03:02:40 +10:00
James Polley
01de499a72 Need a later version of django-countries to support django v1.11 2017-09-30 02:56:02 +10:00
James Polley
953dafa7c3 Remove generate_badges.py symlink. 2017-09-30 02:36:55 +10:00
James Polley
660690c5cf git subrepo pull vendor/registripe
Also update vendored_requirements to make sure we pull this in.

subrepo:
  subdir:   "vendor/registripe"
  merged:   "9fc3645"
upstream:
  origin:   "git@gitlab.com:tchaypo/registrasion-stripe.git"
  branch:   "lca2018"
  commit:   "9fc3645"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 02:30:56 +10:00
James Polley
6eaddfc1d8 Give registripe subrepo a parent 2017-09-30 02:28:49 +10:00
James Polley
5789cbd05e git subrepo init vendor/registripe
subrepo:
  subdir:   "vendor/registripe"
  merged:   "5ebd581"
upstream:
  origin:   "none"
  branch:   "master"
  commit:   "5ebd581"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 02:06:10 +10:00
James Polley
3001324d5e git subrepo pull vendor/registrasion
subrepo:
  subdir:   "vendor/registrasion"
  merged:   "3545a80"
upstream:
  origin:   "git@gitlab.com:tchaypo/registrasion.git"
  branch:   "lca2018"
  commit:   "3545a80"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 01:49:37 +10:00
James Polley
19e4185cd9 Revert "NotImplmented refund"
This reverts commit a162559a05.
2017-09-30 01:48:53 +10:00
James Polley
e546b7d814 Fix qhasuery modification so that conditions are combined
Borrowed from the pyconau-2017 fork

To explain the impact of this - without this patch, if a user has
their invoice refunded, they are able to buy a new ticket; but
t-shirts, dinner tickets and so on do not become available to them
again because they are listed has already been in a cart for them.

Applying the patch now correctly checks to see if they currently have
a ticket.

From 731eee0a4c42a5013ee312b1ff50548e4d89a2ff Mon Sep 17 00:00:00 2001
From: Richard Jones <r1chardj0n3s@gmail.com>
Date: Sun, 4 Jun 2017 13:22:34 +1000
Subject: [PATCH] Fix query modification so that conditions are combined

Previously it was checking if the user has a product from the category
in a cart, and if there is no cart that is released (refunded).
Not *if the user has a product in a cart that is not released*.

This patch combines them. In the absence of a __ne operation in the
joining syntax, a double equality check is needed.

Signed-off-by: Richard Jones <r1chardj0n3s@gmail.com>
2017-09-30 00:44:21 +10:00
James Polley
105e6988e5 Merge migrations with upstream
Find urlencode, wherever it may hide

Further work to using latest upstream registrasion
2017-09-30 00:44:21 +10:00
James Polley
162b5edc20 git subrepo clone git@gitlab.com:tchaypo/registrasion.git vendor/registrasion
subrepo:
  subdir:   "vendor/registrasion"
  merged:   "7cf314a"
upstream:
  origin:   "git@gitlab.com:tchaypo/registrasion.git"
  branch:   "lca2018"
  commit:   "7cf314a"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 00:44:21 +10:00
James Polley
2580584597 Prepare to use the newly-revendored registrasion 2017-09-30 00:44:14 +10:00
James Polley
3c29e3db8c git subrepo pull vendor/registrasion
subrepo:
  subdir:   "vendor/registrasion"
  merged:   "c1e194a"
upstream:
  origin:   "git@gitlab.com:tchaypo/registrasion.git"
  branch:   "lca2018"
  commit:   "c1e194a"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 00:44:14 +10:00
James Polley
26f40ce904 git subrepo init --remote=git@gitlab.com:tchaypo/registrasion.git --branch=lca2018 vendor/registrasion
subrepo:
  subdir:   "vendor/registrasion"
  merged:   "8851e20"
upstream:
  origin:   "git@gitlab.com:tchaypo/registrasion.git"
  branch:   "lca2018"
  commit:   "8851e20"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2017-09-30 00:44:13 +10:00
James Polley
ba98c36868 Add admin links to review sections that the user can manager 2017-09-22 22:46:21 +10:00
James Polley
d22f8e8e35 expand proposal admin 2017-09-22 20:13:48 +10:00
James Polley
183dea0b6e Python3 compatibility in timetable listing
itertools changed a little between py2 and py3
2017-09-17 22:08:39 +10:00
James Polley
494d9a6add Merge speaker migrations
Two different changes have updated the speaker model; this creates a
migration that merges the changes.
2017-09-17 13:16:06 +10:00
James Polley
ecd4bc97bc Expand bulk_accept to generic bulk_update
Allows for bulk rejection/undecided/standby in addition to bulk accept.
2017-09-17 13:15:56 +10:00
James Polley
f4d6fd1db4 Merge branch 'tabindex-for-hack' into 'master'
Don't tab stop on Hack links in proposal creation

See merge request LCA2018/symposion_app!13
2017-09-16 12:23:14 +00:00
James Polley
5114076afa Make review changes atomic
This follows from investigations in
https://rt.lca2018.org/Ticket/Display.html?id=283&results=eac0bd3c49f782d054f87d6b160ca36b;
in short, it seems that because this very long and complex method
creates several different objects at differnt times, the DB has been
getting out of sync; there are more votes recorded then there are
reviews, becuase the table that stores the vote count is updated
before the table that stores the vote and review information

This change is intended to make this operation (and the other
operations that the revew_detail handler performs) atomic, to prevent
things getting further out of step. It does *not* fix the existing
incosistency.

review_delete has been atomicified as well as it likely needs the same
treatment, but this has not been examined in detail.
2017-08-09 12:27:41 +10:00
James Polley
e63f7b7a7e Add reviews to admin interface 2017-08-09 10:35:16 +10:00
James Polley
7fe5a09bfb Return an integer for the slice index.
Resolves:

    File "/app/symposion_app/vendor/symposion/reviews/views.py", line 230, in review_random_proposal
    proposals = proposals[:(len(proposals) + 1) / 2]
    TypeError: slice indices must be integers or None or have an __index__ method
2017-08-08 23:00:36 +00:00
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
df78fec26a Don't tab stop on Hack links in proposal creation
It's really annoying when you are adding a proposal and you hit tab and
end up on the link to the Hack website. There's no need for this and at
least on newer browsers we can pretty easily skip the links for tab.

Unfortunately because this is model text it generates migrations. As we
know these migrations don't actually do anything, so they are annoying
but not actually harmful.
2017-07-02 22:52:53 +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