Commit graph

161 commits

Author SHA1 Message Date
James Polley
971cb5d12d Expand admin ui for checkins to be useful for admins
... also (and this really should be another commit, I am a horrible
person) change name of exception text fields
2018-01-21 11:43:41 +11:00
Sachi King
98465934ff Show attendees shirts in overview
So schwag can be given out
2018-01-21 10:56:27 +11:00
Sachi King
7370fc6012 Add last minute fixes to flow
Exception text storage and check in needs to be sepearte to badge.
2018-01-21 10:45:01 +11:00
Sachi King
05a45b77ed Linkify the rego-code in overview view
Should make checkin of lookups easier, links to the page just after
boarding pass scanning
2018-01-21 10:45:01 +11:00
Sachi King
4b5fe34335 Add regex validation [A-Z0-9]{6} for input
Don't block submition, but give the user a red bar.

Also a link to overview.

Esp if it is 5+ sec to load, we don't need it 90%+ the time, don't page
through it in the scan print workflow.
2018-01-21 10:45:01 +11:00
Sachi King
f25f85f86e Convience redirect on .conf/checkin
Send voli's to the overview, and everyone else to what we want from
them.
2018-01-21 10:45:01 +11:00
Sachi King
8ee0dda5ac Base flow for checkin scanning
It's ugly...  But it should do the job.

Ref #40
2018-01-21 10:45:01 +11:00
James Polley
ac8df2da28 Use waffl to be able to flip overlay on/off 2018-01-21 00:53:02 +11:00
James Polley
23c056e046 Add a waffle.flag in order to force overlay usage 2018-01-21 00:12:06 +11:00
Sachi King
763f69cb61 Add overlay badge support
Support so print can print only important text.

SVG modified to use display:inline/none based on overlay True/False and
a symlink to make it easy to change to a completely seperate svg if that
is not optimal.

SVG added layers to split text and graphic so graphics can be easily
hidden and printed.

Closes: #38
2018-01-20 12:36:09 +11:00
James Polley
a7b619a2fd Need to list items per-user
Without this important line, each user gets the same manifest. not helpful.
2018-01-19 20:18:50 +11:00
James Polley
f9066d25d5 Add checkin code to manifest 2018-01-19 15:05:18 +11:00
James Polley
e120f7a691 Decode the image so it can be re-encoded
#sigh
2018-01-19 08:05:54 +11:00
James Polley
5a6759adae Refactor bpass build/send code
* Pull out the bits that prepare and build the bpass
* Make them not require a request object
* so that we can now call this code from another context
2018-01-19 07:03:44 +11:00
Joel Addison
135c5d2da3 Add track to schedule JSON
Include the track of the slow in the schedule JSON so the miniconf can be identified.
2018-01-18 21:40:14 +11:00
James Polley
ae33da0de4 Chunk responses 2018-01-18 20:57:20 +11:00
James Polley
dc6b7f43ef Enhance boarding poass processes
* Add a note about the creation date of boarding pass
* Add a link to ticket review page
* Try to handle some of the expected errors in the boarding pass
  sending process
* don't just 502, try to handle the error and move on.
2018-01-18 18:49:55 +11:00
James Polley
7d18387670 If no boardingpass, make one
- Use the first template in the system
 - If there's no template, use /tickets/review as it at least gives
 - people an overview of what they've paid for and warns them of
   missing categories
2018-01-16 23:11:14 +11:00
James Polley
3ffa5fab60 Don't require login to view qrcode
* The qrcode contains no information that isn't in the URL you used to
  access the code, so information is being leaked
* Allowing unauthenicated access lets people see the image in their
  mail client

Not ideal. Let's revert this later and think of something better next
year - perhaps spending some more time researching best practices on
images in email..
2018-01-15 08:51:38 +11:00
James Polley
6770e83e5d Switch to png as a plain boring attachment
In the body of the email, we can load the image direct from the
site. Prolly gonna fail a lot but at least it's a loud known visible
failure
2018-01-15 08:21:18 +11:00
James Polley
018f7bef7a Flag plain-text part of the email as being plain-text 2018-01-15 07:59:43 +11:00
James Polley
18fc3bd4a7 Fix typo in list_filter 2018-01-15 06:36:05 +11:00
James Polley
0bc99d8fdb Revert to fixed string in email, for easier substitution
Harder to swap it out when it changes every time..
2018-01-15 03:54:40 +11:00
James Polley
8da6d18098 Enhance session admin to show room names 2018-01-15 03:42:01 +11:00
James Polley
30e65e65a6 Use the fixed template, not the version straight out of the db 2018-01-15 02:57:55 +11:00
James Polley
1f025400e1 Add the boardingpass template 2018-01-15 02:33:47 +11:00
James Polley
6f064455ab Remove errant . in urls 2018-01-15 02:22:52 +11:00
James Polley
79085a798a Create /boardingpass 2018-01-15 02:05:29 +11:00
James Polley
39669055ef Update badge rendering to reflect actual render
* Switch to showing the PNG version by default, as this reflects what
  will actually be rendered and sent to the printer
* Include the greyscale filter
* Include the twemoji font we'll use for rendering the badges
2018-01-15 00:30:30 +11:00
James Polley
653cd80891 Quick and dirty voucher use report
Dumps a list of voucher code, invoice id, invoice details in a listreport.
2018-01-13 20:54:38 +11:00
James Polley
8c0d42ee7f Be more proactive about presenting the right QRcode image 2018-01-13 01:34:25 +11:00
James Polley
2206f647db Make purchase details available for boardingpass templates. 2018-01-13 00:26:49 +11:00
James Polley
98e0abf30c Use filter_vertical for sessions in admin 2018-01-10 22:27:55 +11:00
James Polley
f99765ca0b Add admin action to update slot names
* The slot object updates its name every time it is saved
* But sometimes its slotrooms are changed underneath it, and so the
  name can become out of date
* This method is a simple way of updating the names for all the slots
2018-01-10 22:27:55 +11:00
James Polley
23f4a38126 Add filter on room to Slot admin 2018-01-10 15:58:36 +11:00
James Polley
d30852e5f1 Attach qrcode as attachment 2018-01-07 23:15:46 +11:00
James Polley
0831a4aa76 Add support for a "ready for boarding" group
This allows for the boarding functionality to be safely tested with
just a subset of users first. Once you're ready to go live Fur Reals,
just delete the group and all users will become eligible.
2018-01-07 22:27:15 +11:00
James Polley
e726ff21a8 Create regidesk app
Shows summary of all attendees with a paid ticket, including
boarding_pass status.

Currently, regidesk allows staff with the requisite permission the
ability to view the checkin status of attendees, and email the user
their boarding pass email.

Included is a view for the user to retrieve their own QR code (in case
they got the plain-text version of the email, they can use this to
download an image to their phone for faster checkin)
2018-01-06 11:38:06 +11:00
James Polley
44cdd088be git subrepo clone git@gitlab.com:LCA2018/registrasion-desk.git vendor/regidesk
subrepo:
  subdir:   "vendor/regidesk"
  merged:   "a8096d0"
upstream:
  origin:   "git@gitlab.com:LCA2018/registrasion-desk.git"
  branch:   "master"
  commit:   "a8096d0"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"
2018-01-06 11:38:04 +11:00
James Polley
1fd8364456 Modify limits report to include category inclusions as well
* A TimeOrStockLimit limit can apply a limit to a whole category, or
  to specific products
* This report was only counting the products directly listed
* Take advantage of the new all_products property to include the
  products indirectly listed as well as those directly listed
2018-01-02 12:53:14 +11:00
James Polley
6a9652dfd2 Add an all_products property to FlagBase
It's common to need to query the fill list of products covered by a
Flag - whether directly, or by being in an included category.

Add an all_products property which does this.
2018-01-02 12:53:14 +11:00
James Polley
0e1038de97 Add ticket_type property to Attendee
This vastly simplifies templates and many many things which need to
look this up.
2018-01-01 16:22:04 +11:00
James Polley
9dc2ea4439 Voucher form needs to be processed first
Because otherwise, the firstform (which will not be in a valid start)
throws errors which prevent the voucher form from ever being processed.
2017-12-31 17:23:42 +11:00
James Polley
f675580d6b Add support for badge PDFs also
* Add a greyscale filter to text for more accurate preview
* Always default to SVG preview as it's the most accurate (cairo
  doesn't do a great job of handling custom fonts when it converts to
  png/pdf)
* Always use roboto font.
2017-12-26 23:55:09 +11:00
James Polley
fcbacc82e6 Add views to allow for PNG rendering of badge 2017-12-26 23:10:21 +11:00
James Polley
d14048bcb8 Further changes to support badge generation for lca2018
* Undo some of the debugging done early in this series of patches
* Add ability for a user to preview their own badge
* Add a template for the LCA2018 badge
2017-12-26 21:01:40 +11:00
Sachi King
9ab075e51c Badges work by copy-pasting lca2017/pyconau2017 code around
WIP - Push for share
2017-12-26 04:24:20 +00:00
James Polley
25bff81eab Revert "Fix off-by-one error in rowspan calcuations"
This reverts commit 96a24489b6.
2017-12-25 21:44:31 +11:00
James Polley
96a24489b6 Fix off-by-one error in rowspan calcuations 2017-12-24 19:20:14 +11:00
James Polley
b833b7d869 Order slots by room order first
* lca2018 has a situation where we have multiple slots starting at the
  same time, but ending at different times
* The headers of the timetable grid are sorted by room sort order
* In sqlite at least, ordering by start,order seems to implicitly
  resolve duplicate start times by looking at the other sort fields
  first, and will only sort on order if all other fields are identical

* This results in the slot that ends first going in column 1, which
  gets out of sync with the room listed in the header

* I can't figure out how to solve this in the database, so...

* Force the slots to be sorted by room order.
* Then, for each start_time, select out slots starting at that time
  and operate on them
* This both gets the slots in the right order *and* keeps multi-room
  slots with the right colspan. Yay!

* It's possible that this wouldn't be needed on some DBs which might
do the sorting differently.
2017-12-24 19:20:04 +11:00
James Polley
193ffc76d5 List rooms in slot admin
In many parts of the schedule there are multiple slots with the same
start/end times, and it can be hard to find the one you want to edit.

Make this slightly simpler by listing the room names in the admin list.
2017-12-24 13:54:57 +11:00
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