Commit graph

1401 commits

Author SHA1 Message Date
Aurélien Delobelle
0815c96c1c Merge branch 'Kerl/postgres' into 'master'
Préparation au passage à postgres
- Suppression du champ num du modèle CofProfile.
- Suppression des LOCK (spécifique MySQL).
- Le code devient compatible avec tous les backends supportés par Django.
- Suppressions de code servant à la compatibilité python2.
- Corrige le message de succès à la fin de l'inscription. Celui-ci ne prenait pas en compte le statut is_cof à jour du profil.

See merge request !234
2017-05-23 22:50:10 +02:00
Martin Pépin
3a69c3371f Simple test: we can query the account-read page 2017-05-23 20:38:53 +01:00
Martin Pépin
74135f8877 enhance User.__str__ with get_full_name 2017-05-23 16:50:43 +01:00
Martin Pepin
92c946a286 Merge branch 'aureplop/clean_perms' into 'master'
Clean K-Fêt permissions

See merge request !235
2017-05-23 17:40:58 +02:00
Aurélien Delobelle
1d269ef4f9 Update migration to keep perms.
If content type for old kfet.GlobalPermissions exists:
- custom permissions related to this content type are updated to new content types,
- then we can safely remove this content type.
2017-05-23 16:48:33 +02:00
Aurélien Delobelle
cd5a2e0591 Move K-Fêt global permissions. 2017-05-23 13:47:40 +02:00
Martin Pépin
3c8f1c58c5 Use transaction.atomic instead of lock_table
lock_table used LOCK which is mysql-specific
2017-05-23 05:58:09 +01:00
Martin Pépin
f0f1585661 Registration: remove success var, fix message
`member.profile` was not up-to-date where we used to send the success
message => move it to the place where the success var is set tu `True`
and remove the success var was which becomes irrelevant.
2017-05-23 05:41:57 +01:00
Aurélien Delobelle
a36d002b17 Merge branch 'Kerl/apt_upgrade' into 'master'
Upgrade apt packages while provisioning

See merge request !233
2017-05-22 15:08:16 +02:00
Martin Pépin
3762b38afe Remove useless pip upgrade in bootstrap.sh 2017-05-22 10:29:38 +01:00
Martin Pépin
dba8a0a857 Remove the num field in CofProfile 2017-05-22 01:00:32 +01:00
Martin Pépin
76dcaf7d51 drop py2 compat 2017-05-21 23:58:44 +01:00
Martin Pépin
17b140fb12 Upgrade apt packages while provisioning 2017-05-21 18:42:30 +01:00
Aurélien Delobelle
95a8b484e0 Merge branch 'Aufinal/fix_history' into 'master'
Fix asynchronous calls with resetSettings

See merge request !229
2017-05-15 23:43:28 +02:00
Ludovic Stephan
647b32e727 Move displayAddcost function 2017-05-15 17:52:49 -03:00
Martin Pepin
6871945dcd Merge branch 'aureplop/fix_perms' into 'master'
Fix UserGroupForm

Closes #161

See merge request !228
2017-05-15 11:29:33 +02:00
Ludovic Stephan
bf0e345301 Fix asynchronous calls with resetSettings
The `resetSettings` function now returns the ajax object, allowing to
chain other calls to it, e.g. the `getHistory` function.
2017-05-14 23:50:09 -03:00
Aurélien Delobelle
e0b1db1e1e more robust tests 2017-05-14 22:19:25 +02:00
Martin Pepin
5d8427e601 Merge branch 'aureplop/fewer_requests' into 'master'
Moins de requêtes

See merge request !217
2017-05-12 21:13:35 +02:00
Aurélien Delobelle
4ac7b30bdd Fix UserGroupForm + tests for this form.
- Non-K-Fêt group membership is no longer erased by the account edit
  form.
- Add some tests to ensure proposed choices in this form corresponds to
  K-Fêt groups + test case for #161.

Fixes #161
2017-05-12 16:55:18 +02:00
Aurélien Delobelle
b1e46792c8 (little) cleaning of order_create view 2017-05-10 13:11:47 +02:00
Aurélien Delobelle
b0e7ebfbc5 fix typo + pep8 + del future imports 2017-05-10 12:49:14 +02:00
Aurélien Delobelle
6cdb791989 fix class name conflicts 2017-05-10 12:39:56 +02:00
Aurélien Delobelle
4ed5128829 Merge branch 'Kerl/settings2' into 'master'
Add settings for redis and fix settings handling in the provisioning script

See merge request !227
2017-04-26 11:19:44 +02:00
Martin Pépin
fb4258f821 Set the redis passwd properly in bootstrap.sh 2017-04-25 20:23:51 +01:00
Martin Pépin
dbff7740c8 Add REDIS_PORT to the settings and secrets 2017-04-25 20:23:21 +01:00
Ludovic Stephan
5c5fc6da1b Merge branch 'aureplop/less_prices_history' into 'master'
Less articles prices history

Closes #142

See merge request !224
2017-04-25 14:32:18 +02:00
Martin Pépin
52d9979d7c Fix settings in the provisioning script 2017-04-24 22:17:41 +01:00
Martin Pépin
2aee43e01a Add more configuration options for redis
- `REDIS_HOST` can be specified in the secrets
- Two new secrets: `REDIS_PASSWD` and `REDIS_DB`
2017-04-24 22:17:41 +01:00
Aurélien Delobelle
0d8a613f28 improve bda inscription form/view code 2017-04-21 18:22:53 +02:00
Aurélien Delobelle
2eee8f58aa Merge branch 'master' into aureplop/fewer_requests 2017-04-17 20:45:01 +02:00
Aurélien Delobelle
8622002e8d minor change 2017-04-17 20:40:54 +02:00
Aurélien Delobelle
a0fe94e2f4 Merge branch 'Kerl/settings' into 'master'
New organisation of settings files
- common.py: the settings that are shared by all the environments we have + the secrets (see below).
- dev.py: the settings used by the vagrant VM for local development.
- prod.py: the production settings (for both www.cof.ens.fr and dev.cof.ens.fr)
- secret.py: some settings like the SECRET_KEY or the database's credentials are loaded from an untracked file called secret.py in the same directory. This secrets are loaded by the common settings file.


See merge request !222
2017-04-15 14:25:47 +02:00
Martin Pépin
ff73a635f8 Minor fixes in settings/
- Typo
- Removes old comments
- Moves the template debug context processor back to the common file: it
  won't be loaded anyway if `DEBUG=False`.
- Ddt's middleware should be loaded first
2017-04-15 11:09:16 +01:00
Ludovic Stephan
55b509b3dd Merge branch 'aureplop/fix_negative' into 'master'
Check negative on cancellation.

Closes #156

See merge request !223
2017-04-13 18:20:24 +02:00
Aurélien Delobelle
7db497d095 Less articles prices history
- Prices given with order_to_inventory are saved to db only if they are
  updated (it doesn't create a new price row each time)

Fixes #142.
2017-04-13 16:34:29 +02:00
Aurélien Delobelle
9668f1d1ec Account: check_negative() -> update_negative() 2017-04-13 15:48:13 +02:00
Aurélien Delobelle
18425b82c2 Check negative on cancellation.
- Like perform operations, cancel_operations can add/remove an account
  from negative accounts system.
- Balances checks are now performed against real_balance instead of
  balance.
  So if someone with a balance_offset go, for real, to positive land (ie even
  without taking into account the balance offset), its account is removed from
  the negative system.
- Fix bug on real_balance when negative exists but balance_offset is
  not set.

Fixes #156.
2017-04-13 15:15:59 +02:00
Aurélien Delobelle
06572f0bb5 Order create use Scale.
Order create view use WeekScale. No query improvements, only shorter
code.

Scale/ScaleMixin:
- Two methods directly relative to the Scale class move to... the Scale
  class.

- Fix order create on Chrome.
2017-04-13 14:11:44 +02:00
Aurélien Delobelle
3f4a1adbb9 Fewer queries on stats/scales + Fix
Scales:
- Fix #chunks when used with std_chunk=True (there was one too many at
  the beginning)
- Scale.end gives the end of the last chunk (instead of its start)
  So scale.begin -> scale.end gives the full range of the scale.

`kfet_day` now returns an aware datetime.

ScaleMixin:
- new method `get_by_chunks` which use only one query and ranks
  elements according to the scale. Elements are returned by a generator
  for each scale chunk (and all chunks are returned as a generator too).

ArticlesStatSales and AccountStatOperations use this new method to
avoid issuing #scale_chunks queries.

ArticleStat:
- fixed on Chrome
2017-04-12 18:03:31 +02:00
Aurélien Delobelle
e97e0081d7 Fewer queries on stats of an account balance.
- Remove labels, should be replaced to an anchor to the relative
  operation in history.
- Add select_related as necessary.
2017-04-11 23:13:54 +02:00
Aurélien Delobelle
b5cc26bb1b Merge branch 'master' into aureplop/fewer_requests 2017-04-11 22:46:18 +02:00
Martin Pepin
a725f8020c Merge branch 'aureplop/clean_channels' into 'master'
Aureplop/clean channels

Closes #67

See merge request !220
2017-04-11 00:42:08 +02:00
Aurélien Delobelle
b357283f87 Merge branch 'master' into aureplop/clean_channels 2017-04-11 00:32:07 +02:00
Martin Pépin
40abe81402 Integrate the new settings workflow into vagrant 2017-04-10 23:01:19 +01:00
Martin Pépin
a5fb162aaf New organisation of settings files
We reproduce what has been done here:
https://github.com/dissemin/dissemin

The following files can be found under `cof/settings/`
- `common.py`: the settings that are shared by all the environments we
  have + the secrets (see below).
- `dev.py`: the settings used by the vagrant VM for local development.
- `prod.py`: the production settings (for both www.cof.ens.fr and
  dev.cof.ens.fr)

There is also a notion of "secrets". Some settings like the `SECRET_KEY`
or the database's credentials are loaded from an untracked files called
`secret.py` in the same directory. This secrets are loaded by the common
settings file.
2017-04-10 23:01:19 +01:00
Martin Pepin
a68002d0f6 Merge branch 'aureplop/fix_double_js' into 'master'
Fix stats on some browsers

See merge request !219
2017-04-10 23:59:02 +02:00
Martin Pepin
495c6ac3d1 Merge branch 'aureplop/kfet_config' into 'master'
Configuration utilisateur K-Fêt

See merge request !210
2017-04-10 21:14:37 +02:00
Aurélien Delobelle
5d6012b6bd Fix kfet tests
- and add test for `kfet_config.subvention_cof`
2017-04-10 11:52:57 +02:00
Aurélien Delobelle
c228416809 Subvention -> Réduction + units for kfet_config
- kfet_config gives "reduction_cof" as editable instead of
  "subvention_cof"
- this last one can still be accessed via kfet_config (computed from
  new "reduction_cof"
- add units to numeric values of kfet_config form
2017-04-10 11:36:06 +02:00