Commit Graph

171 Commits

Author SHA1 Message Date
Skia
87295ad9b7
Galaxy improvements (#628)
* galaxy: improve logging and performance reporting

* galaxy: add a full galaxy state test

* galaxy: optimize user self score computation

* galaxy: add 'generate_galaxy_test_data' command for development at scale

* galaxy: big refactor

Main changes:
  - Multiple Galaxy objects can now exist at the same time in DB. This allows for ruling a new galaxy while still
    displaying the old one.
  - The criteria to quickly know whether a user is a possible citizen is now a simple query on picture count. This
    avoids a very complicated query to database, that could often result in huge working memory load. With this change,
    it should be possible to run the galaxy even on a vanilla Postgres that didn't receive fine tuning for the Sith's
    galaxy.

* galaxy: template: make the galaxy graph work and be usable with a lot of stars

- Display focused star and its connections clearly
- Display star label faintly by default for other stars to avoid overloading the graph
- Hide non-focused lanes
- Avoid clicks on non-highlighted, too far stars
- Make the canva adapt its width to initial screen size, doesn't work dynamically

* galaxy: better docstrings

* galaxy: use bulk_create whenever possible

This is a big performance gain, especially for the tests.

Examples:

----

`./manage.py test galaxy.tests.GalaxyTest.test_full_galaxy_state`

Measurements averaged over 3 run on *my machine*™:
Before: 2min15s
After: 1m41s

----

`./manage.py generate_galaxy_test_data --user-pack-count 1`

Before: 48s
After: 25s

----

`./manage.py rule_galaxy` (for 600 citizen, corresponding to 1 user-pack)

Before: 14m4s
After: 12m34s

* core: populate: use a less ambiguous 'timezone.now()'

When running the tests around midnight, the day is changing, leading to some values being offset to the next day
depending on the timezone, and making some tests to fail. This ensure to use a less ambiguous `now` when populating
the database.

* write more extensive documentation

- add documentation to previously documented classes and functions and refactor some of the documented one, in accordance to the PEP257 and ReStructuredText standards ;
- add some type hints ;
- use a NamedTuple for the `Galaxy.compute_users_score` method instead of a raw tuple. Also change a little bit the logic in the function which call the latter ;
- add some additional parameter checks on a few functions ;
- change a little bit the logic of the log level setting for the galaxy related commands.

* galaxy: tests: split Model and View for more efficient data usage

---------

Co-authored-by: maréchal <thgirod@hotmail.com>
2023-05-10 12:47:02 +02:00
thomas girod
ef968f3673
Better usage of cache for groups and clubs related operations (#634)
* Better usage of cache for group retrieval

* Cache clearing on object deletion or update

* replace signals by save and delete override

* add is_anonymous check in is_owned_by

Add in many is_owned_by(self, user) methods that user is not anonymous. Since many of those functions do db queries, this should reduce a little bit the load of the db.

* Stricter usage of User.is_in_group

Constrain the parameters that can be passed to the function to make sure only a str or an int can be used. Also force to explicitly specify if the group id or the group name is used.

* write test and correct bugs

* remove forgotten populate commands

* Correct test
2023-05-02 12:36:59 +02:00
thomas girod
96dede5077
Speed up tests (#638) 2023-05-02 11:00:23 +02:00
thomas girod
b5a40cfda9
Mise à jour de Black vers la version 23.3 (#629) 2023-04-22 15:32:31 +02:00
Julien Constant
8e7c025e47
[FIX] Broken link in readme and license fix (& update) (#591) 2023-04-04 18:39:45 +02:00
Skia
585923c827
Add galaxy (#562)
* style.scss: lint

* style.scss: add 'th' padding

* core: populate: add much more data for development

* Add galaxy
2023-02-07 12:08:25 +01:00
Thomas Girod
fe9e5ce861 integration of 3D secure v2 for eboutic bank payment 2022-11-30 22:52:56 +01:00
Thomas Girod
8b09ba2924 refonte de la boutique en ligne 2022-10-30 12:33:21 +01:00
lsacienne
ba6599fa56
Add of tests 2022-05-05 23:24:08 +02:00
tleb
be26e3df7f core: add ./manage.py check_front command and call it on runserver 2021-09-27 22:00:36 +02:00
f34f5fe693
Upgrade black and format accordingly 2020-08-27 15:59:42 +02:00
1256744f1b
documentation: add autoreload and build for documentation server 2019-11-20 17:03:18 +01:00
99c8d95443
django2.2: remove direct assignments to many-to-many fields 2019-10-08 22:46:37 +02:00
2a9b89fd2a
core: remove README wiki page that wasn't helpful and anyway broken with rst files 2019-10-08 11:12:22 +02:00
5c3c14ab37
core: wrap compilemessages to avoid compiling whole env and avoid crash at sphinx messages compilation 2019-10-08 00:59:00 +02:00
8809753108
documentation fix tests because of missing README.md 2019-10-07 23:51:37 +02:00
05e5008305
documentation: base structure for new documentation 2019-10-07 23:51:35 +02:00
358a625cc4
pedagogy: simplify and implement department system according to old database model 2019-06-18 10:56:05 +02:00
38f6c27983
pedagogy: tests for uv creation 2019-06-16 12:19:04 +02:00
ec33311715
pedagogy: basic display list of UV 2019-06-15 23:31:31 +02:00
5bf5d0277c
pedagogy: create view and form for UV
WARNING: A new group has been created, to be set by the infra team at deployment !!!
2019-06-15 17:01:25 +02:00
5ae7d10e84
Add unit tests for student cards and fix edge cases 2019-05-20 17:56:09 +02:00
654099067e
clubs: tests for adding mailings 2019-05-09 20:32:26 +02:00
72a4bde6a2 user: fix populate for dev and use native django function to fetch payment_method 2018-10-16 14:52:47 +02:00
cb58b00b6e
All: Apply Black coding rules 2018-10-05 21:52:55 +02:00
08de5dfe6a
Migration to django 1.11 2018-06-10 16:31:58 +02:00
Skia
0d3c34c155 core/models: refactor SithFile moving and add methods to manage filesystem
Signed-off-by: Skia <skia@libskia.so>
2018-04-16 18:35:00 +02:00
Skia
9b0b381fa3 core: make populate command more predictable (should fix the random failing test)
Signed-off-by: Skia <skia@libskia.so>
2017-10-14 13:51:50 +02:00
baa7be69e4
Better integration of wiki pages on clubs 2017-10-06 11:09:31 +02:00
939146bddd
Sync pages with club unix_name 2017-10-06 11:09:29 +02:00
fe69cbcee1
Add page for clubs and inactive clubs 2017-10-06 11:09:29 +02:00
Skia
cda89d66cd com: improve news page
Signed-off-by: Skia <skia@libskia.so>
2017-09-26 12:13:23 +02:00
Skia
4edb9a78c6 com: add agenda on news page
Signed-off-by: Skia <skia@libskia.so>
2017-09-01 12:22:38 +02:00
Skia
0d5595c683 core: add test for Markdown syntax
Signed-off-by: Skia <skia@libskia.so>
2017-08-24 16:30:46 +02:00
748e3ae326 Refactor and migration corrections 2017-08-15 13:57:49 +02:00
d60e14a303 Migration from old database 2017-08-15 13:57:49 +02:00
40927fa13d Add limit for ecocup recording 2017-08-15 13:57:49 +02:00
e7de8b2aec Format core 2017-06-13 10:04:13 +02:00
0af72500c6 Add some tests on counter 2017-06-07 18:36:26 +02:00
Skia
63acf588ca Add basic unfinished counter test 2017-06-07 18:36:26 +02:00
e59d769dac Doc for scss 2017-05-10 11:13:49 +02:00
d083a67725 Change year of license on some files 2017-05-10 10:49:34 +02:00
acef5be8b3 New lite home made scss processor 2017-05-10 10:49:34 +02:00
630fdf93a4 Refactoring for compilestatic 2017-05-10 10:49:34 +02:00
79c769351d Add simple way to compile scss files 2017-05-10 10:49:34 +02:00
Skia
a12b772587 Add some Eboutic tests 2017-05-01 19:39:28 +02:00
b5363c2987 Firsts tests for elections 2017-04-25 15:30:57 +02:00
Skia
83deae5964 Apply GPLv3 to Sith, and add header to every concerned file 2017-04-24 17:51:12 +02:00
Skia
254126fd79 Add last unread function 2017-02-06 20:20:39 +01:00
Skia
ff77df3646 Add basic right management to forum. Need to test it! 2017-01-21 04:51:37 +01:00
Skia
ea52462217 Add Forum 2017-01-21 03:42:06 +01:00
Skia
83555a3640 Add preferences and improve weekmail 2017-01-15 22:58:38 +01:00
Skia
9d1eaed625 Make some weekmail views 2017-01-15 22:58:37 +01:00
Skia
d400995e9d Update setup command to ease development 2017-01-07 10:36:54 +01:00
Skia
c6422fdd30 Add SYNTAX.md 2016-12-26 01:42:45 +01:00
Skia
1dd28672b0 Add Markdown test to populate 2016-12-26 01:36:07 +01:00
e17fd22a37 Fix populate after rebase 2016-12-25 20:24:18 +01:00
97f835eb4e Convert indent with space, fix populate and add an s 2016-12-25 19:54:10 +01:00
1f60fbd484 Uses election_detail for vote form 2016-12-25 19:54:10 +01:00
Skia
177e39bd6e Fix RuntimeWarning in populate 2016-12-25 19:54:10 +01:00
Jean-Baptiste Lenglet
94d15684b7 Added profile pictures for users 2016-12-25 19:53:04 +01:00
d72d8366cf Add new widget (not tested) and new bdd scheme for elections 2016-12-25 19:52:14 +01:00
7956067686 Election right update 2016-12-25 19:52:14 +01:00
2764f6d2d2 Refactor List Model 2016-12-25 19:52:14 +01:00
c604282b77 Nice display for elections 2016-12-25 19:52:14 +01:00
52e69b0ac1 Refactor elections 2016-12-25 19:52:14 +01:00
a284637190 Normally fixs tests 2016-12-25 19:52:14 +01:00
fd3309fc5f Refactor election bdd 2016-12-25 19:52:14 +01:00
d685e9ba29 Election bdd + first view 2016-12-25 19:52:14 +01:00
f7b4258f20 populate updated 2016-12-24 16:16:14 +01:00
418537bc8e tests for accounting added 2016-12-24 16:16:14 +01:00
93211d8ada operations added in populate 2016-12-21 05:19:16 +01:00
Skia
168622a04d Add com app with first parametric texts 2016-12-21 02:38:21 +01:00
7227a5d6f9 Refactor refounding function 2016-12-15 12:17:19 +01:00
e231c612c6 Separate counter for account refounding 2016-12-15 11:46:36 +01:00
Skia
28431ec9be Big refactor: remove Subscriber class 2016-12-10 01:58:30 +01:00
Skia
0d4b697079 Refactor group settings 2016-12-10 01:29:56 +01:00
3c8a4f068e Refound Account 2016-11-30 08:19:52 +01:00
Skia
585ba55e5e Continue SAS 2016-11-23 11:46:40 +01:00
Skia
0b068d3e92 Improve file moderation 2016-11-23 11:30:57 +01:00
Skia
59f5917b8c Fix Page locking 2016-11-05 13:37:39 +01:00
Skia
325da79e45 Add support for subscription typed products in eboutic 2016-08-29 03:02:13 +02:00
Skia
a033c4dfd2 Improve launderette rights to match with launderette club 2016-08-13 16:39:09 +02:00
Skia
4ec328556e Migrate clubs 2016-08-13 16:08:22 +02:00
Skia
c0a66f9a38 Finish profile of users 2016-08-13 05:33:09 +02:00
Skia
43b709bfd5 Make file modale chooser and complete user profile 2016-08-11 04:30:24 +02:00
Skia
a8858fa781 Add home for users and clubs 2016-08-10 16:23:12 +02:00
Skia
a0f7150c55 Update accounting to have a target 2016-08-07 20:10:50 +02:00
Skia
2cf39671e2 Make some more validation on the token click form 2016-08-01 19:59:22 +02:00
Skia
4d8e7b0875 Improve launderette, need to finish the click view 2016-08-01 16:36:16 +02:00
Skia
a01fc63a82 Begin launderette 2016-07-28 20:05:56 +02:00
Skia
593050d9e2 Improve greatly the counter right management 2016-07-18 00:47:56 +02:00
Skia
f600e174b1 CSS and templating, Sith begins to look nice 2016-07-16 16:35:45 +02:00
Skia
67114f51e1 Fix populate to work with Postgres 2016-07-14 17:51:26 +02:00
Skia
0eb203b18b Fix populate with subscriptions 2016-07-14 16:13:43 +02:00
Skia
d244618dd0 Improve accounting views 2016-06-22 13:19:35 +02:00
Skia
ffe2aec980 Implement barman prices and improve counter views 2016-06-01 01:33:20 +02:00
Skia
6c48b7c718 Add Selling and Refilling classes 2016-05-31 19:32:15 +02:00
Skia
8da149c979 Some refactoring between accounting and counter 2016-05-31 13:00:52 +02:00
Skia
27805640a1 Improve right handling for accounting 2016-05-09 11:49:01 +02:00