Commit graph

1352 commits

Author SHA1 Message Date
Aurélien Delobelle
e7266e7a9d use new settings for redis 2017-04-26 11:28:18 +02:00
Aurélien Delobelle
673dc0295d Merge branch 'master' into aureplop/fix_cache 2017-04-26 11:22:29 +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
dbf5844f6a Clean settings redis 2017-04-15 14:41:55 +02:00
Aurélien Delobelle
e772d12721 Merge branch 'master' into aureplop/fix_cache 2017-04-15 14:27:20 +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
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
Aurélien Delobelle
2a3c892d39 Merge branch 'master' into aureplop/fix_cache 2017-04-10 21:39:54 +02:00
Aurélien Delobelle
36771c2c4f Use redis for cache.
- Cache use db #1 of redis.
- Channel layer (of channels) use db #0 of redis.
- `settings` try getting redis connection variables from environment.
- Drop memcached system
2017-04-10 21:36:00 +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
ab31c20649 missing CACHES value... 2017-04-10 19:47:00 +02:00
Aurélien Delobelle
2c40838938 Add real cache support
- Fix cache per process issue with a real cache system
- Configuration seems too easy... but it seems to work
2017-04-10 19:47:00 +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
Aurélien Delobelle
029d59e615 Enable authentication on KPsul websocket.
- PermConsumerMixin allows checking permissions on connection to a
  consumer.
- KPsul consumer uses this mixin to check if connecting user has the
  permission `kfet.is_team`.

Fixes #67.
2017-04-09 16:10:27 +02:00
Aurélien Delobelle
1e18c4043e Use last channels & co versions
- Use last official releases of channels, asgiref, daphne and
  asgi-redis packages.
- Customization of JsonWebsocketConsumer is now in kfet app through a
  custom class (and so, doesn't require anymore a forked version of channels).
- Clean kfet consumers code.
2017-04-09 15:47:16 +02:00
Aurélien Delobelle
ebfe5c41d4 Fix stats on some browsers
- Delete double import in account_read template
- Syntax on account_read

Stats didn't show on Chrome (at least v57) cause of these.
2017-04-09 01:52:26 +02:00
Aurélien Delobelle
e89ff68d3b add misisng import 2017-04-09 01:39:18 +02:00
Aurélien Delobelle
457ee64004 update migrations order 2017-04-08 18:38:47 +02:00
Aurélien Delobelle
784ba9bd10 Merge branch 'master' into aureplop/kfet_config 2017-04-08 18:36:28 +02:00
Aurélien Delobelle
15861824b6 Merge branch 'Aufinal/tabs' into 'master'
K-Fêt
- Détails d'un compte: historique et stats sont accessibles par des onglets.

See merge request !218
2017-04-08 14:41:36 +02:00
Ludovic Stephan
4a6bfd5e3d Better button distinction 2017-04-07 12:58:03 -03:00
Ludovic Stephan
052e7b2b6e Move navigation to content-left 2017-04-07 12:17:36 -03:00
Ludovic Stephan
e26668e5eb Add tabs to account_read 2017-04-06 21:17:47 -03:00
Aurélien Delobelle
a0979c220b Merge branch 'bda_pep8' into 'master'
Clean the `bda.views.catalogue` view

See merge request !212
2017-04-06 21:24:18 +02:00
Ludovic Stephan
5e68fcf315 Merge branch 'aureplop/hotfix' into 'master'
Aureplop/hotfix

See merge request !214
2017-04-06 00:32:29 +02:00
Aurélien Delobelle
4b2e20e728 created_at required with default 2017-04-06 00:31:04 +02:00
Aurélien Delobelle
e2d7192b23 fix perform opes after account reset 2017-04-06 00:11:41 +02:00
Aurélien Delobelle
c849306a32 fix kfet home template 2017-04-06 00:00:53 +02:00
Martin Pépin
981759f5ce Adds tests covering the bda-catalogue JSON API 2017-04-05 21:02:00 +01:00
Martin Pépin
9ec151e040 A query optimization in bda.views.catalogue
We only need to fetch shows identifiers here:

    FOO.filter(BAR__in=shows)

which can be done using the `values_list` method
2017-04-05 20:48:18 +01:00
Martin Pépin
ff9cee5ffc line too long in bda.models 2017-04-05 20:42:50 +01:00
Martin Pépin
853a239e6e Rewrite bda.views.catalogue
- No string concatenations
- Use `get_object_or_404` instead of performing a `.get` and catching
  the eventual exception.
- More accurate error messages when a bad request is detected.
- More accurate error handling
2017-04-05 19:53:04 +01:00
Aurélien Delobelle
ebf948d042 Merge branch 'qwann/k-fet/category_addcost' into 'master'
K-Fêt - Majorations
- Seulement les catégories préalablement sélectionnées sont majorées le 
le cas échéant.
- Pour modifier cette sélection, suivre le lien "Catégories" depuis la
liste des articles.

Fixes #149

See merge request !189
2017-04-05 15:52:15 +02:00
Aurélien Delobelle
3ee9de93d9 few improvements on article category
- add verbose names to ArticleCategory fields
- add button to view categories list from articles list
- fix article_update template in form validation
- improve interface for articlecategory_update
- revert vanished urls (happened in merge with master...)
2017-04-05 15:34:28 +02:00
Aurélien Delobelle
42728e58be Merge branch 'master' into qwann/k-fet/category_addcost 2017-04-05 14:57:26 +02:00