Switch Dockerfile from CMD to ENTRYPOINT so that flags can be passed
to the makemigrations command
This is required in cases where we need to use django's makemigrations
--merge to merge two migrations.
* This reference was added in the very distant past
* But jquery.history.js itself has never been in the repo
* pyconau-2017 team resolved the dilemma but dropping
jquery.history.js into the repo
* But as near as I can tell, this does nothing except in obsolete
older browsers. The fact that it's been broken ever since it was
"added" is highly suggestive of it never having ever been used or
needed
* So, trim the fat. It's possible that this might break an older
browser that needs the functionality jquery.history.js provides -
except that such a browser would *already* be broken because
jquery.history.js has never actually been around to be used.
* If we ever do need this functionality, we can revert this
change.. and then we'd have to drop in jquery.history.js. In that
circumstance,
https://github.com/pyconau2017/symposion/commit/34bc7c0 may be of interest.
* Adds an env variable to .env to turn on dev mode
* Uses the inbuilt django auth rather than saml when in dev mode
* For laziness, re-uses the admin login form for the non-admin login
make_dev_container now comes up ready to be logged into by any
user. No non-admin users are preconfigured; but you can add one at
http://localhost:28000/admin/auth/user/add/, log out, and then hit
http://localhost:28000/ to log in as the new user.
Expand on support for devs by scripting the process of creating,
starting, and initialising a dev container.
Take container name as an optional parameter
* Adds a laptop-mode-env file which docker can read env variables from
* Adds a Dockerfile.makemigrations; mostly identical to the main
Dockerfile. Important difference: instead of the source being copied
into the docker image at build time, it's mounted from the local
machine at run time.
* Adds a makemigrations shell script which builds an imagine using the
Dockefile.makemigrations and then uses it to run makemigrations
* Because the source is mounted from the local machine, any new
migrations created are dumped in the developer's git checkout ready
for adding to git.
Rename .env -> docker/laptop-mode-env
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.
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
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
Create a ephemeral dev container to facilitate testing of
populate_inventory. It can be created, tweeked in the admin interface,
files updated in admin's populate_inventory, then redeployed to deal
with those changes.
A branch based one will need to be created to so we can do this work
without polluting the master branch.
This improves the administrative workflow of deploying updated images to
the k8s cluster. Still tag latest however, as that's important to
old-workflow.
Would be good to block this and have it fail on a db migration so it
doesn't happen accidently, and make the deployer deal with it.
Editing a miniconf, on save, the code looks in settings for
ADMIN_USERNAMES, and as it does not exist, we stack-trace and 502 to the
user.
Add the attribute to settings.py
* 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.
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.
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.