fixed formatting
Update rootplace/forms.py
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
Check that a user cannot be merged into itself
ajout des traductions
changed test language to french
Check that a user cannot be merged into itself
* Upgrade openapi-ts
* Migrate openapi-ts settings to new version
* Add csrf token to headers of all API calls
* Force csrf token authentication on API routes
La plupart des variables du `.env.example` n'ont pas besoin d'être modifiées régulièrement et ont déjà des valeurs par défaut dans le `settings.py` qui sont adaptées à un environnement local.
En gardant uniquement les variables qui seront régulièrement modifiées, on rend le fichier plus compréhensible et plus simple à maintenir.
Le formulaire remplaçait la totalité des groupes de l'utilisateur, c'est-à-dire également les groupes pas affichés dans le formulaire. Ça fait que la soumission du formulaire retirait l'utilisateur de tous ses groupes de groupes et des autres groupes non-gérables manuellement (comme Publique et Anciens Cotisants).
Jusqu'ici, les groupes non-manuels étaient gérés bizarrement, en regardant dynamiquement à chaque fois si l'utilisateur est dans le groupe, donc le bug ne se voyait pas. Maintenant que tous les groupes sont gérés presque de la même manière, ça se voit.
Les motifs de cette déprécation sont indiqués dans la documentation.
Le mixin a été remplacé par `PermissionRequiredMixin` dans les endroits où ce remplacement était aisé.
* Remove ability to refill from counters
* Fix bug where you could refill without any board member on a BAR
* Add a warning message explaining why refilling are disabled
* Move settings.SITH_COUNTER_PAYMENT_METHOD to counter.apps.PAYMENT_METHOD
* Move student cards to an accordion on counter click
* Make cash default refilling option
* Disable bank selection option in refilling if CHECK are not allowed
* Disable refilling with CHECK from the frontend
Intercept htmx on submit requests, this allows auto submit from nfc fields
Fix super call with parameters
Add loading wheel on student card form for counter_click.jinja
- a missing `fail_silently` flag made the whole command fail if an invalid recipient is used (like closed utbm mail address)
- Not specifying the seller make the account detail pages crash.
* Convert FileModerationView into ListView and add pagination with htmx
* Don't allow sas moderation in file moderation view
* Split up base.jinja and introduce base_fragment.jinja
* Improve FileModerationView performances and make it root only
* Add permissions tests for file modération
Since 28f397574f and the removal of the
`flex-basis: 50px` property from `user_profile_pictures_thumbnails`,
the main picture was always displayed small-ish, at least on Firefox.
Setting back a flex-basis helps getting more consistent behavior once
again.
* Fix display
* Add internationalization
* Avoid querying under a certain amount of characters
* Update docs for translations with typescript
* Add interpolate to typescript globals
La limite actuelle est trop faible. En soirée, on s'en fout. Mais en journée, c'est terriblement chiant. Certains barmens passent leur temps à rafraichir la la page, certains mettent un rechargement auto à intervalles réguliers (ce qui tue le concept du timeout), et d'autres encore ont juste arrêté d'y prêter attention (mais le comptoir apparait alors comme fermé, et des étudiants qui auraient pu venir au Foyer ne viennent finalement pas)
Le timeout se fait en une seule requête et la récupération de l'état des comptoirs en une seule requête aussi. Grâce à ça, on peut en grande partie retirer le cache pour l'affichage de l'état des comptoirs, ce qui a des implications excellentes en termes d'UX (comme le fait que la redirection vers la page de comptoir ou d'activité aura plus une apparence de truc aléatoire)
En raison de la manière dont le timeout marche et de l'activité des comptoirs, la notion de "comptoir inactif" n'est pas intuitive. Un comptoir est ouvert ou fermé. Point.
* Remove graphviz and use cytoscape.js instead
* Frontend generated graphs
* Make installation easier and faster
* Better user experience
* Family api and improved interface
* Fix url history when using 0, improve button selection and reset reverse with reset button
* Use klay layout
* Add js translations and apply review comments
* update_spam_database command to update suspicious domains from an
external provider
* Add a AntiSpamEmailField that deny emails from suspicious domains
* Update documentation
* use pytest for tests
Eh ouais, il y a que la config qui change. Pytest est implémentable par étapes. Et ça c'est beau.
* rework tests with pytest
* remove unittest custom TestRunner
* Edit doc and CI
* integration of 3D secure v2 for eboutic bank payment
* edit yml to avoid git conflict when deploying on test
* escape html characters on xml (#505)
* Change country id to ISO 3166 1 numeric for 3DSV2 (#510)
* remove useless tests
* Fix le panier de l'Eboutic pour Safari (#518)
Co-authored-by: Théo DURR <git@theodurr.fr>
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
* update some dependencies (#523)
* [Eboutic] Fix double quote issue & improved user experience on small screen (#522)
* Fix#511 Regex issue with escaped double quotes
* Fix basket being when reloading the page (when cookie != "")
+ Added JSDoc
+ Cleaned some code
* Fix#509 Improved user experience on small screens
* Fix css class not being added back when reloading page
* CSS Fixes (see description)
+ Fixed overlaping item title with the cart emoji on small screen
+ Fixed minimal size of the basket on small screen (full width)
* Added darkened background circle to items with no image
* Fix issue were the basket could be None
* Edited CSS to have bette img ratio & the 🛒 icon
Adapt, Improve, Overcome
* Moved basket down on small screen size
* enhance admin pages
* update documentation
* Update doc/about/tech.rst
Co-authored-by: Julien Constant <49886317+Juknum@users.noreply.github.com>
* remove csrf_token
* Fix 3DSv2 implementation (#542)
* Fixed wrong HMAC signature generation
* Fix xml du panier
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* [FIX] 3DSv2 - Echappement du XML et modif tables (#543)
* Fixed wrong HMAC signature generation
* Updated migration files
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* Update doc/about/tech.rst
* Update doc/start/install.rst
* Updated lock file according to pyproject
* unify account_id creation
* upgrade re_path to path (#533)
* redirect directly on counter if user is barman
* Passage de vue à Alpine pour les comptoirs (#561)
Vue, c'est cool, mais avec Django c'est un peu chiant à utiliser. Alpine a l'avantage d'être plus léger et d'avoir une syntaxe qui ne ressemble pas à celle de Jinja (ce qui évite d'avoir à mettre des {% raw %} partout).
* resolved importError (#565)
* Add galaxy (#562)
* style.scss: lint
* style.scss: add 'th' padding
* core: populate: add much more data for development
* Add galaxy
* repair user merging tool (#498)
* Disabled galaxy feature (only visually)
* Disabled Galaxy button & Removed 404 exception display
* Update 404.jinja
* Fixed broken test
* Added eurocks links to eboutic
* fix typo
* fix wording
Co-authored-by: Théo DURR <git@theodurr.fr>
* Edited unit tests
This test caused a breach in security due to the alert block displaying sensitive data.
* Repair NaN bug for autocomplete on counter click
* remove-useless-queries-counter-stats (#519)
* Amélioration des pages utilisateurs pour les petits écrans (#578, #520)
- Refonte de l'organisation des pages utilisateurs (principalement du front)
- Page des parrains/fillots
- Page d'édition du profil
- Page du profil
- Page des outils
- Page des préférences
- Page des stats utilisateurs
- Refonte du CSS / organisation de la navbar principale (en haut de l'écran)
- Refonte du CSS de la navbar bleu clair (le menu)
- Refonte du CSS du SAS :
- Page de photo
- Page d'albums
* Added GA/Clubs Google Calendar to main page (#585)
* Added GA/Clubs google calendar to main page
* Made tables full width
* Create dependabot.yml (#587)
* Bump django from 3.2.16 to 3.2.18 (#574)
* [CSS] Follow up of #578 (#589)
* [FIX] Broken link in readme and license fix (& update) (#591)
* Fixes pour la mise à jour de mars (#598)
* Fix problème de cache dans le SAS & améliore le CSS du SAS
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
* Fixes & améliorations du nouveau CSS (#616)
* [UPDATE] Bump sentry-sdk from 1.12.1 to 1.19.1 (#620)
* [FIX] Fixes supplémentaires pour la màj de mars (#622)
- Les photos de l'onglet de la page utilisateur utilise désormais leur version thumbnail au lieu de leur version HD
- Une des classes du CSS du SAS a été renommée car elle empiétait sur une class de la navbar
- Le profil utilisateur a été revu pour ajouter plus d'espacement entre le tableau des cotisations et le numéro de cotisants
- Les images de forum & blouse sont de nouveau cliquable pour les afficher en grands
- Sur mobile, lorsqu'on cliquait sur le premier élément de la navbar, ce dernier avait un overlay avec des angles arrondis
- Sur mobile, les utilisateurs avec des images de profils non carrées dépassait dans l'onglet Famille
* [UPDATE] Bump dict2xml from 1.7.2 to 1.7.3 (#592)
Bumps [dict2xml](https://github.com/delfick/python-dict2xml) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/delfick/python-dict2xml/releases)
- [Commits](https://github.com/delfick/python-dict2xml/compare/release-1.7.2...release-1.7.3)
---
updated-dependencies:
- dependency-name: dict2xml
dependency-type: direct:production
update-type: version-update:semver-patch
...
* [UPDATE] Bump django-debug-toolbar from 3.8.1 to 4.0.0 (#593)
Bumps [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) from 3.8.1 to 4.0.0.
- [Release notes](https://github.com/jazzband/django-debug-toolbar/releases)
- [Changelog](https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst)
- [Commits](https://github.com/jazzband/django-debug-toolbar/compare/3.8.1...4.0.0)
---
updated-dependencies:
- dependency-name: django-debug-toolbar
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump cryptography from 37.0.4 to 40.0.1 (#594)
* [UPDATE] Bump cryptography from 37.0.4 to 40.0.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.4 to 40.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/37.0.4...40.0.1)
---
updated-dependencies:
- dependency-name: cryptography
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* Updated pyOpenSSL to match cryptography requirements
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* Mise à jour de Black vers la version 23.3 (#629)
* update link for poetry install
* [UPDATE] Bump django-countries from 7.5 to 7.5.1 (#624)
Bumps [django-countries](https://github.com/SmileyChris/django-countries) from 7.5 to 7.5.1.
- [Release notes](https://github.com/SmileyChris/django-countries/releases)
- [Changelog](https://github.com/SmileyChris/django-countries/blob/main/CHANGES.rst)
- [Commits](https://github.com/SmileyChris/django-countries/compare/v7.5...v7.5.1)
---
updated-dependencies:
- dependency-name: django-countries
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump sentry-sdk from 1.19.1 to 1.21.0
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.19.1 to 1.21.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.19.1...1.21.0)
---
updated-dependencies:
- dependency-name: sentry-sdk
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* Speed up tests (#638)
* 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
* [FIX] Correction de bugs (#617)
* Fix#600
* Fix#602
* Fixes & améliorations du nouveau CSS (#616)
* Fix#604
* should fix#605
* Fix#608
* Update core/views/site.py
Co-Authored-By: thomas girod <56346771+imperosol@users.noreply.github.com>
* Added back the permission denied
* Should fix#609
* Fix failing test when 2 user are merged
* Should fix#610
* Should fix#627
* Should fix#109
Block les URLs suivantes lorsque le fichier se trouve dans le dir `profiles` ou `SAS` :
- `/file/<id>/`
- `/file/<id>/[delete|prop|edit]`
> Les urls du SAS restent accessiblent pour les roots & les admins SAS
> Les urls de profiles sont uniquement accessiblent aux roots
* Fix root dir of SAS being unnaccessible for sas admins
⚠️ need to edit the SAS directory & save it (no changes required in sas directory properties)
* Remove overwritten code
* Should fix duplicated albums in user profile (wtf)
* Fix typo
* Extended profiles picture access to board members
* Should fix#607
* Fix keyboard navigation not working properly
* Fix user tagged pictures section inside python rather than in the template
* Update utils.py
* Apply suggested changes
* Fix#604
* Fix#608
* Added back the permission denied
* Should fix duplicated albums in user profile (wtf)
* Fix user tagged pictures section inside python rather than in the template
* Apply suggested changes
---------
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
* Remove duplicated css
* 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>
* [UPDATE] Bump libsass from 0.21.0 to 0.22.0 (#640)
Bumps [libsass](https://github.com/sass/libsass-python) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/sass/libsass-python/releases)
- [Changelog](https://github.com/sass/libsass-python/blob/main/docs/changes.rst)
- [Commits](https://github.com/sass/libsass-python/compare/0.21.0...0.22.0)
---
updated-dependencies:
- dependency-name: libsass
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [FIX] Fix cached groups (#647)
* Bump sqlparse from 0.4.3 to 0.4.4 (#645)
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/andialbrecht/sqlparse/releases)
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.3...0.4.4)
---
updated-dependencies:
- dependency-name: sqlparse
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump django-ordered-model from 3.6 to 3.7.4 (#625)
Bumps [django-ordered-model](https://github.com/django-ordered-model/django-ordered-model) from 3.6 to 3.7.4.
- [Release notes](https://github.com/django-ordered-model/django-ordered-model/releases)
- [Changelog](https://github.com/django-ordered-model/django-ordered-model/blob/master/CHANGES.md)
- [Commits](https://github.com/django-ordered-model/django-ordered-model/compare/3.6...3.7.4)
---
updated-dependencies:
- dependency-name: django-ordered-model
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix immutable default variable in `get_start_of_semester` (#656)
Le serveur ne percevait pas le changement de semestre, parce
que la valeur par défaut passée à la fonction `get_start_of_semester()` était une fonction appelée une seule fois, lors du lancement du serveur. Bref, c'était ça : https://beta.ruff.rs/docs/rules/function-call-in-default-argument/
---------
Co-authored-by: imperosol <thgirod@hotmail.com>
* Add missing method on AnonymousUser (#649)
* Add eurocks partnership in the eboutic (#661)
* Add eurocks partnership in the eboutic (#661)
Revert "Add eurocks partnership in the eboutic (#661)"
This reverts commit 193c820757.
Add eurocks partnership in the eboutic (#661)
* Update workflow
Following this update : https://github.blog/changelog/2023-09-13-github-actions-updates-to-github_ref-and-github-ref/
* Update workflow
* Remove eurocks tickets from eboutic (event is finished)
* Links update & translations typos fixes (#671)
* Remove BDF link (as BDF is now part of AE)
* Remove unused pages
* Fix typos
* Fix typo again
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Thomas Girod <thgirod@hotmail.com>
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
Co-authored-by: Théo DURR <git@theodurr.fr>
Co-authored-by: Skia <skia@hya.sk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
* integration of 3D secure v2 for eboutic bank payment
* edit yml to avoid git conflict when deploying on test
* escape html characters on xml (#505)
* Change country id to ISO 3166 1 numeric for 3DSV2 (#510)
* remove useless tests
* Fix le panier de l'Eboutic pour Safari (#518)
Co-authored-by: Théo DURR <git@theodurr.fr>
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
* update some dependencies (#523)
* [Eboutic] Fix double quote issue & improved user experience on small screen (#522)
* Fix#511 Regex issue with escaped double quotes
* Fix basket being when reloading the page (when cookie != "")
+ Added JSDoc
+ Cleaned some code
* Fix#509 Improved user experience on small screens
* Fix css class not being added back when reloading page
* CSS Fixes (see description)
+ Fixed overlaping item title with the cart emoji on small screen
+ Fixed minimal size of the basket on small screen (full width)
* Added darkened background circle to items with no image
* Fix issue were the basket could be None
* Edited CSS to have bette img ratio & the 🛒 icon
Adapt, Improve, Overcome
* Moved basket down on small screen size
* enhance admin pages
* update documentation
* Update doc/about/tech.rst
Co-authored-by: Julien Constant <49886317+Juknum@users.noreply.github.com>
* remove csrf_token
* Fix 3DSv2 implementation (#542)
* Fixed wrong HMAC signature generation
* Fix xml du panier
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* [FIX] 3DSv2 - Echappement du XML et modif tables (#543)
* Fixed wrong HMAC signature generation
* Updated migration files
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* Update doc/about/tech.rst
* Update doc/start/install.rst
* Updated lock file according to pyproject
* unify account_id creation
* upgrade re_path to path (#533)
* redirect directly on counter if user is barman
* Passage de vue à Alpine pour les comptoirs (#561)
Vue, c'est cool, mais avec Django c'est un peu chiant à utiliser. Alpine a l'avantage d'être plus léger et d'avoir une syntaxe qui ne ressemble pas à celle de Jinja (ce qui évite d'avoir à mettre des {% raw %} partout).
* resolved importError (#565)
* Add galaxy (#562)
* style.scss: lint
* style.scss: add 'th' padding
* core: populate: add much more data for development
* Add galaxy
* repair user merging tool (#498)
* Disabled galaxy feature (only visually)
* Disabled Galaxy button & Removed 404 exception display
* Update 404.jinja
* Fixed broken test
* Added eurocks links to eboutic
* fix typo
* fix wording
Co-authored-by: Théo DURR <git@theodurr.fr>
* Edited unit tests
This test caused a breach in security due to the alert block displaying sensitive data.
* Repair NaN bug for autocomplete on counter click
* remove-useless-queries-counter-stats (#519)
* Amélioration des pages utilisateurs pour les petits écrans (#578, #520)
- Refonte de l'organisation des pages utilisateurs (principalement du front)
- Page des parrains/fillots
- Page d'édition du profil
- Page du profil
- Page des outils
- Page des préférences
- Page des stats utilisateurs
- Refonte du CSS / organisation de la navbar principale (en haut de l'écran)
- Refonte du CSS de la navbar bleu clair (le menu)
- Refonte du CSS du SAS :
- Page de photo
- Page d'albums
* Added GA/Clubs Google Calendar to main page (#585)
* Added GA/Clubs google calendar to main page
* Made tables full width
* Create dependabot.yml (#587)
* Bump django from 3.2.16 to 3.2.18 (#574)
* [CSS] Follow up of #578 (#589)
* [FIX] Broken link in readme and license fix (& update) (#591)
* Fixes pour la mise à jour de mars (#598)
* Fix problème de cache dans le SAS & améliore le CSS du SAS
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
* Fixes & améliorations du nouveau CSS (#616)
* [UPDATE] Bump sentry-sdk from 1.12.1 to 1.19.1 (#620)
* [FIX] Fixes supplémentaires pour la màj de mars (#622)
- Les photos de l'onglet de la page utilisateur utilise désormais leur version thumbnail au lieu de leur version HD
- Une des classes du CSS du SAS a été renommée car elle empiétait sur une class de la navbar
- Le profil utilisateur a été revu pour ajouter plus d'espacement entre le tableau des cotisations et le numéro de cotisants
- Les images de forum & blouse sont de nouveau cliquable pour les afficher en grands
- Sur mobile, lorsqu'on cliquait sur le premier élément de la navbar, ce dernier avait un overlay avec des angles arrondis
- Sur mobile, les utilisateurs avec des images de profils non carrées dépassait dans l'onglet Famille
* [UPDATE] Bump dict2xml from 1.7.2 to 1.7.3 (#592)
Bumps [dict2xml](https://github.com/delfick/python-dict2xml) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/delfick/python-dict2xml/releases)
- [Commits](https://github.com/delfick/python-dict2xml/compare/release-1.7.2...release-1.7.3)
---
updated-dependencies:
- dependency-name: dict2xml
dependency-type: direct:production
update-type: version-update:semver-patch
...
* [UPDATE] Bump django-debug-toolbar from 3.8.1 to 4.0.0 (#593)
Bumps [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) from 3.8.1 to 4.0.0.
- [Release notes](https://github.com/jazzband/django-debug-toolbar/releases)
- [Changelog](https://github.com/jazzband/django-debug-toolbar/blob/main/docs/changes.rst)
- [Commits](https://github.com/jazzband/django-debug-toolbar/compare/3.8.1...4.0.0)
---
updated-dependencies:
- dependency-name: django-debug-toolbar
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump cryptography from 37.0.4 to 40.0.1 (#594)
* [UPDATE] Bump cryptography from 37.0.4 to 40.0.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.4 to 40.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/37.0.4...40.0.1)
---
updated-dependencies:
- dependency-name: cryptography
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* Updated pyOpenSSL to match cryptography requirements
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* Mise à jour de Black vers la version 23.3 (#629)
* update link for poetry install
* [UPDATE] Bump django-countries from 7.5 to 7.5.1 (#624)
Bumps [django-countries](https://github.com/SmileyChris/django-countries) from 7.5 to 7.5.1.
- [Release notes](https://github.com/SmileyChris/django-countries/releases)
- [Changelog](https://github.com/SmileyChris/django-countries/blob/main/CHANGES.rst)
- [Commits](https://github.com/SmileyChris/django-countries/compare/v7.5...v7.5.1)
---
updated-dependencies:
- dependency-name: django-countries
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump sentry-sdk from 1.19.1 to 1.21.0
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.19.1 to 1.21.0.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.19.1...1.21.0)
---
updated-dependencies:
- dependency-name: sentry-sdk
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* Speed up tests (#638)
* 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
* [FIX] Correction de bugs (#617)
* Fix#600
* Fix#602
* Fixes & améliorations du nouveau CSS (#616)
* Fix#604
* should fix#605
* Fix#608
* Update core/views/site.py
Co-Authored-By: thomas girod <56346771+imperosol@users.noreply.github.com>
* Added back the permission denied
* Should fix#609
* Fix failing test when 2 user are merged
* Should fix#610
* Should fix#627
* Should fix#109
Block les URLs suivantes lorsque le fichier se trouve dans le dir `profiles` ou `SAS` :
- `/file/<id>/`
- `/file/<id>/[delete|prop|edit]`
> Les urls du SAS restent accessiblent pour les roots & les admins SAS
> Les urls de profiles sont uniquement accessiblent aux roots
* Fix root dir of SAS being unnaccessible for sas admins
⚠️ need to edit the SAS directory & save it (no changes required in sas directory properties)
* Remove overwritten code
* Should fix duplicated albums in user profile (wtf)
* Fix typo
* Extended profiles picture access to board members
* Should fix#607
* Fix keyboard navigation not working properly
* Fix user tagged pictures section inside python rather than in the template
* Update utils.py
* Apply suggested changes
* Fix#604
* Fix#608
* Added back the permission denied
* Should fix duplicated albums in user profile (wtf)
* Fix user tagged pictures section inside python rather than in the template
* Apply suggested changes
---------
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
* Remove duplicated css
* 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>
* [UPDATE] Bump libsass from 0.21.0 to 0.22.0 (#640)
Bumps [libsass](https://github.com/sass/libsass-python) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/sass/libsass-python/releases)
- [Changelog](https://github.com/sass/libsass-python/blob/main/docs/changes.rst)
- [Commits](https://github.com/sass/libsass-python/compare/0.21.0...0.22.0)
---
updated-dependencies:
- dependency-name: libsass
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [FIX] Fix cached groups (#647)
* Bump sqlparse from 0.4.3 to 0.4.4 (#645)
Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/andialbrecht/sqlparse/releases)
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.3...0.4.4)
---
updated-dependencies:
- dependency-name: sqlparse
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [UPDATE] Bump django-ordered-model from 3.6 to 3.7.4 (#625)
Bumps [django-ordered-model](https://github.com/django-ordered-model/django-ordered-model) from 3.6 to 3.7.4.
- [Release notes](https://github.com/django-ordered-model/django-ordered-model/releases)
- [Changelog](https://github.com/django-ordered-model/django-ordered-model/blob/master/CHANGES.md)
- [Commits](https://github.com/django-ordered-model/django-ordered-model/compare/3.6...3.7.4)
---
updated-dependencies:
- dependency-name: django-ordered-model
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix immutable default variable in `get_start_of_semester` (#656)
Le serveur ne percevait pas le changement de semestre, parce
que la valeur par défaut passée à la fonction `get_start_of_semester()` était une fonction appelée une seule fois, lors du lancement du serveur. Bref, c'était ça : https://beta.ruff.rs/docs/rules/function-call-in-default-argument/
---------
Co-authored-by: imperosol <thgirod@hotmail.com>
* Add missing method on AnonymousUser (#649)
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Thomas Girod <thgirod@hotmail.com>
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
Co-authored-by: Théo DURR <git@theodurr.fr>
Co-authored-by: Skia <skia@hya.sk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bartuccio Antoine <klmp200@users.noreply.github.com>
Le serveur ne percevait pas le changement de semestre, parce
que la valeur par défaut passée à la fonction `get_start_of_semester()` était une fonction appelée une seule fois, lors du lancement du serveur. Bref, c'était ça : https://beta.ruff.rs/docs/rules/function-call-in-default-argument/
---------
Co-authored-by: imperosol <thgirod@hotmail.com>
* 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>
* Fix#600
* Fix#602
* Fixes & améliorations du nouveau CSS (#616)
* Fix#604
* should fix#605
* Fix#608
* Update core/views/site.py
Co-Authored-By: thomas girod <56346771+imperosol@users.noreply.github.com>
* Added back the permission denied
* Should fix#609
* Fix failing test when 2 user are merged
* Should fix#610
* Should fix#627
* Should fix#109
Block les URLs suivantes lorsque le fichier se trouve dans le dir `profiles` ou `SAS` :
- `/file/<id>/`
- `/file/<id>/[delete|prop|edit]`
> Les urls du SAS restent accessiblent pour les roots & les admins SAS
> Les urls de profiles sont uniquement accessiblent aux roots
* Fix root dir of SAS being unnaccessible for sas admins
⚠️ need to edit the SAS directory & save it (no changes required in sas directory properties)
* Remove overwritten code
* Should fix duplicated albums in user profile (wtf)
* Fix typo
* Extended profiles picture access to board members
* Should fix#607
* Fix keyboard navigation not working properly
* Fix user tagged pictures section inside python rather than in the template
* Update utils.py
* Apply suggested changes
* Fix#604
* Fix#608
* Added back the permission denied
* Should fix duplicated albums in user profile (wtf)
* Fix user tagged pictures section inside python rather than in the template
* Apply suggested changes
---------
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
* 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
- Les photos de l'onglet de la page utilisateur utilise désormais leur version thumbnail au lieu de leur version HD
- Une des classes du CSS du SAS a été renommée car elle empiétait sur une class de la navbar
- Le profil utilisateur a été revu pour ajouter plus d'espacement entre le tableau des cotisations et le numéro de cotisants
- Les images de forum & blouse sont de nouveau cliquable pour les afficher en grands
- Sur mobile, lorsqu'on cliquait sur le premier élément de la navbar, ce dernier avait un overlay avec des angles arrondis
- Sur mobile, les utilisateurs avec des images de profils non carrées dépassait dans l'onglet Famille
- Les photos de l'onglet de la page utilisateur utilise désormais leur version thumbnail au lieu de leur version HD
- Une des classes du CSS du SAS a été renommée car elle empiétait sur une class de la navbar
- Le profil utilisateur a été revu pour ajouter plus d'espacement entre le tableau des cotisations et le numéro de cotisants
- Les images de forum & blouse sont de nouveau cliquable pour les afficher en grands
- Sur mobile, lorsqu'on cliquait sur le premier élément de la navbar, ce dernier avait un overlay avec des angles arrondis
- Sur mobile, les utilisateurs avec des images de profils non carrées dépassait dans l'onglet Famille
- Refonte de l'organisation des pages utilisateurs (principalement du front)
- Page des parrains/fillots
- Page d'édition du profil
- Page du profil
- Page des outils
- Page des préférences
- Page des stats utilisateurs
- Refonte du CSS / organisation de la navbar principale (en haut de l'écran)
- Refonte du CSS de la navbar bleu clair (le menu)
- Refonte du CSS du SAS :
- Page de photo
- Page d'albums
Vue, c'est cool, mais avec Django c'est un peu chiant à utiliser. Alpine a l'avantage d'être plus léger et d'avoir une syntaxe qui ne ressemble pas à celle de Jinja (ce qui évite d'avoir à mettre des {% raw %} partout).
Eboutic :
- Implémentation de la norme 3DSecure v2 pour les paiement par carte bancaire
- Amélioration générale de l'interface utilisateur
- Résolution du problème avec les caractères spéciaux dans le panier sur Safari
- Réparation du cookie du panier de l'eboutic qui n'était pas fonctionnel
Autre :
- Mise à jour de la documentation
- Mise à jour des dépendances Javascript
- Suppression du code inutilisé dans `subscription/models.py`
- Amélioration des pages administrateur (back-office Django)
Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com>
Co-authored-by: Théo DURR <git@theodurr.fr>
Co-authored-by: Julien Constant <julienconstant190@gmail.com>
* Fix#511 Regex issue with escaped double quotes
* Fix basket being when reloading the page (when cookie != "")
+ Added JSDoc
+ Cleaned some code
* Fix#509 Improved user experience on small screens
* Fix css class not being added back when reloading page
* CSS Fixes (see description)
+ Fixed overlaping item title with the cart emoji on small screen
+ Fixed minimal size of the basket on small screen (full width)
* Added darkened background circle to items with no image
* Fix issue were the basket could be None
* Edited CSS to have bette img ratio & the 🛒 icon
Adapt, Improve, Overcome
* Moved basket down on small screen size
Résoud le soucis lié à dependabot.
Le problème venait du fait que l'on faisait un poetry update et non un poetry Install. Un update écrit dans poetry.lock, alors qu'un Install lit ce fichier. C'est là toute la différence.
Cette PR change donc les workflows.
Laisser ce bot apporte beaucoup de sécurité, vu qu'il nous prévient des changement, et aussi des vulnérabilités au niveau des dépendances.
* Fix election candidate overflowing texte
* Fix "Show Less" invisible still occurring in production (wtf)
* Fix program text still overflowing still occurring in production (wtf)
Bonus:
* Fix miss-aligned links in navbar
- Fixed a wrong condition on the users subscribing history `read` permission.
- The comments are clearer and mentions how to specify clubs by their id.
Fix 'download all my picture button' being displayed in all albums sections
This MR fix the following issue where the download all button is displayed in each album (hence it's for all photos & not only by album)

See merge request ae-utbm/Sith!320
Update de base.jinja
Defer des balises script. Ajout de preload sur l'import de fontawesome. Changement de certains commentaires html en commentaires jinja.
Le deux premiers points devraient permettre de gagner un temps non-négligeable au chargement de la page.
See merge request ae-utbm/Sith!317
💄 Change banner to invitation banner
We must set an invitation banner again. For the next one, we should create a new feature with a new button to avoid doing this switch every time.
See merge request ae-utbm/Sith!314
Improved Elections CSS for the table
- Everything can be seen without scrolling sideways (unless you're on a small screen)
- Each column makes the same size
- Candidate description/program is now below its profile picture
- If the candidate does not have any profile picture, the default one is shown
- The Edit/Delete message has been replaced with their corresponding emojis (they takes fewer spaces and doesn't need to be translated)
- Modified links at the bottom to look like buttons
<details><summary>Before</summary>

</details>
<details><summary>This MR (root)</summary>

</details>
<details><summary>This MR (lambda user)</summary>

</details>
<details><summary>When a candidate is selected</summary>

</details>
See merge request ae-utbm/Sith!313
Change the invitation banner in weekmail to regular weekmail banner
We now have the weekmail banner and not the invitation banner
See merge request ae-utbm/Sith!312
Modification of the banner and footer for the Special General Meeting
There will be a special general meeting next week so we modify the banner to fit with this event.
See merge request ae-utbm/Sith!311
Add authorization to refill to the counters AE & BdF
Since the FIMU is coming, there is a necessity to allow access to physical refilling to the people who will manage the stands.
Therefore, We should authorize the refilling on the BdF and AE counter.
See merge request ae-utbm/Sith!309
Ajout de pygraphviz en dépendance
Closes#125
On change également la version minimale de python (`3.7` -> `3.8`)
Closes#125
See merge request ae-utbm/Sith!306
Adds a Restriction for refilling
As it was asked by many members of the AE. I added a restriction applied to the barmens.
In fact, we oftenly loose money due to the physic refilling.
The goal with this change is to only allow **the members of the AE** to refill with physic money.
See merge request ae-utbm/Sith!303
gitlab-ci: deploy with Gitlab CI/CD
This MR is a proof-of-concept for deploying the Sith using Gitlab CI/CD. It leverage the CI variable to use a private key that is deployed for the `sith` user of `ae-web`. The `prod.sh` script shall do the rest.
TODO before merge:
* [x] Ensure the private key variable is protected (currently done, but may change during development to be used on this branch)
* [x] Remove this branch from the `only:refs` list
* [x] Change `test_prod.sh` for the real script
See merge request ae/Sith!293
Add of date in the counter/refilling_list view
I only add a new field in the counter/refilling_list view which will *normally* display the date of each refilling.
See merge request ae/Sith!302
Add missing dependencies and improve pipeline
* Use black version specified in requirements for checking with black
* Check if pyproject.toml file is valid at CI level
* Build documentation in CI
* Add missing postgres dependencie
See merge request ae/Sith!284
Multiple fixes
* Bump `black` and fix issues
* `club`: fix tests broken by inclusive translation
* `gitlab-ci`: use `poetry`, as `pip` was broken anyway
* `eboutic`: et_autoanswer: don't require 'Auto' to proceed checking the request: As described in the [doc](https://www.paybox.com/espace-integrateur-documentation/la-solution-paybox-system/gestion-de-la-reponse/), `Auto` may be missing if the payment failed. Thus, it's not required to proceed checking the bank's answer.
See merge request ae/Sith!296
Add pronouns to option list in profile
Modify "Sex" translation to "Genre"
Added "Other" to sex option list (alongside Man and Woman)
update DB,add default value to Pronouns field
Update views.py
If an email address is set as destination for the Weekmail, the SMTP may
refuse it, and `smtplib` will throw a `SMTPRecipientsRefused` error,
containing the list of refused addresses. This commit provides an
interface for the weekmail sender to quickly unsubscribe the faulty
users, so that the next try sending the weekmail can be performed
successfully.
Add a first version of a mobile friendly UI
Although not perfect and with many flaws, this should still allow far
easier navigation on mobile devices.
See merge request ae/Sith!280
CI speedup
* Put the Xapian search index in `/dev/shm`, which is an in-memory storage makes the tests go from about 1500s to about 600s.
* Keep the `pip` cache between jobs, to avoid re-downloading all the wheels all the time. This gains about 1min.
See merge request ae/Sith!279
Remove gender option of matmatronche & update gender settings
Afin de se mettre à jour il est dorénavant possible de ne pas définir son genre sexué sur l'édit de son profil. D'ailleurs j'ai découvert que de base pour un profil random le sexe était défini sur "Homme" maintenant il est en "-------" !

De plus afin que personnes n'utilisent l'outil matmatronche à des fins de site de rencontres en cherchant uniquement les "Homme" ou les "Femme" d'une promo etc... Le choix du sexe dans la recherche a été supprimé.

C'est la première fois que je fais une modification en solo alors n'hésitez pas à me casser en deux et m'expliquer si j'ai fauté :D
See merge request ae/Sith!264
core: create TzAwareDateTimeField to replace forms.DateTimeField
Follow up of !267. I read about Gitlab's slash and merge just after I did my own kind by resetting back to the original commit and creating one commit manually. Sublime merge helps but I still need more practice. :)
What was the right way to group every commit under one?
See merge request ae/Sith!270
Sexy search
The goal of this MR is to solve the search issue #96. Let's assume we have a user with firstname `Jean-François`, lastname `Du Pont` and nickname `Ai'gnan`. Here is a list of search that did not include him previously but now includes him (was and still is case-insensitive):
* `jean françois` (missing -) ;
* `jean-francois` (missing ç) ;
* `jean francois` (both) ;
* `dupont` (space) ;
* `françois` (not the start of his name) ;
* `aignan` (missing ').
You get it, there are a lot of mistakes that humans can do. It also sorts results by `User.last_update` to avoid putting old accounts at the top of common requests (such as firstname-only or lastname-only requests).
### How it works
For those who don't know, the search is handled by Xapian (the search backend) through the haystack library which provides a Django-friendly interface to multiple search backends. Xapian maintains kind of a duplicate of the database (only for models against which we want to search something) which is optimised for search operations. Its "models" are called "indexes" (see `core.search_indexes.UserIndex` for the user model).
Every time a user is created or modified, it is indexed (through a signal handler) so that Xapian knows about it. For the user search, what is indexed is the string outputted by the `core/templates/search/indexes/core/user_auto.txt` template. For our example from above, it looks like this:
```
jean francois
du pont
aignan
jeanfrancois
dupont
jeanfrancoisdupont
```
As you can see, unicode is removed. There also are kind-of duplicates with different spacing as we are using an autocomplete algorithm: it searches from the beginning of words.
The one I am not sure about is the last one. Its goal is to allow searching without putting a space between the firstname and lastname. Is this useful?
The prod will have to do a `./manage.py update_index`, not sure it does it in the upgrade script.
See merge request ae/Sith!269
Settings: Added new subscription for the new CA offer
This year we made a new deal with the CA: if a student open an account, they give us 50€ and the student 80€ with on year of subscription.
See merge request ae/Sith!276
core: add ./manage.py check_front command and call it on runserver
See #92 and !268.
This simplifies checking that front-end dependencies are up to date. It does not allow one to update an outdated dependency. That must be done manually (would otherwise require depending on a CDN or add npm as a dependency). A manual update will make sure changelogs are read and changes will be made appropriately.
We add a `check_front` command to `manage.py` and run it on calls to `runserver`.
This MR does not update any dependency as it is not its goal. MR incoming!
Should doc be added? It seems pretty simple and I don't see what should be documented: if it's red, update it.
~"Review TODO" @sli
See merge request ae/Sith!271
This makes the whole click page load only once for a normal click
workflow. The current basket is now rendered client side with Vue.JS,
and the backend view is able to answer with JSON if asked to.
This should lighten the workflow a lot on the client side, especially
with poor connectivity, and the server should also feel lighter during
big events, due to far less complex Jinja pages to render.
This will lighten the pages and make the functionality directly
accessible without ever scrolling the header garbage that is never
needed on those pages.
Enfin, il s'agit de créer la base de donnée de test lors de la première utilisation
```bash
./manage.py setup
```
Et pour lancer le sith, tu fais `python3 manage.py runserver`
Voilà, c'est le sith AE. Il y a des issues dans le gitlab qui sont à régler. Si tu as un domaine qui t'intéresse, une appli que tu voudrais développer, n'hésites pas et contacte-nous.
Va, et que l'AE soit avec toi.
# Black
Pour uniformiser le formattage du code nous utilisons [Black](https://github.com/ambv/black). Cela permet d'avoir le même codestyle et donc le codereview prend moins de temps. Tout étant dans le même format, il est plus facile pour chacun de comprendre le code de chacun ! Cela permet aussi d'éviter des erreurs (y parait 🤷♀️).
Installation de black:
```bash
pip install black
```
## Sous VsCode:
Attention, pour VsCode, Black doit être installé dans votre virtualenv !
Ajouter ces deux lignes dans les settings de VsCode
```json
{
"python.formatting.provider":"black",
"editor.formatOnSave":true
}
```
## Sous Sublime Text
Il faut installer le plugin [sublack](https://packagecontrol.io/packages/sublack) depuis Package Control.
Il suffit ensuite d'ajouter dans les settings du projet (ou en global)
```json
{
"sublack.black_on_save":true
}
```
Si vous utilisez le plugin [anaconda](http://damnwidget.github.io/anaconda/), pensez à modifier les paramètres du linter pep8 pour éviter de recevoir des warnings dans le formatage de black
[](https://squidfunk.github.io/mkdocs-material/)
[](https://biomejs.dev)
### This is the source code of the UTBM's student association available at [https://ae.utbm.fr/](https://ae.utbm.fr/).
You may need to install some dev libraries like `libmysqlclient-dev`, `libssl-dev`, `libjpeg-dev`, `python3-xapian`, or `zlib1g-dev` to install all the
requiered dependancies with pip. You may also need `mysql-client`. Don't also forget `python3-dev` if you don't have it
already.
All documentation is in the `docs` directory and online at [https://ae-utbm.github.io/sith](https://ae-utbm.github.io/sith). This documentation is written in French because it targets a French audience and it's too much work to maintain two versions. The code and code comments are strictly written in English.
To start the simple development server, just run `python3 manage.py runserver`
For more informations, check out the CONTRIBUTING.md file.
### Logging errors with sentry
To connect the app to sentry.io, you must set the variable SENTRY_DSN in your settings custom. It's composed of the full link given on your sentry project
### Generating documentation
There is a Doxyfile at the root of the project, meaning that if you have Doxygen, you can run `doxygen Doxyfile` to
generate a complete HTML documentation that will be available in the *./doc/html/* folder.
### Collecting statics for production:
We use scss in the project. In development environment (DEBUG=True), scss is compiled every time the file is needed. For production, it assumes you have already compiled every files and to do so, you need to use the following commands :
```bash
./manage.py collectstatic # To collect statics
./manage.py compilestatic # To compile scss in those statics
```
### Misc about development
#### Controlling the rights
When you need to protect an object, there are three levels:
* Editing the object properties
* Editing the object various values
* Viewing the object
Now you have many solutions in your model:
* You can define a `is_owned_by(self, user)`, a `can_be_edited_by(self, user)`, and/or a `can_be_viewed_by(self, user)`
method, each returning True is the user passed can edit/view the object, False otherwise.
This allows you to make complex request when the group solution is not powerful enough.
It's useful too when you want to define class-wide permissions, e.g. the club members, that are viewable only for
Subscribers.
* You can add an `owner_group` field, as a ForeignKey to Group. Second is an `edit_groups` field, as a ManyToMany to
Group, and third is a `view_groups`, same as for edit.
Finally, when building a class based view, which is highly advised, you just have to inherit it from CanEditPropMixin,
CanEditMixin, or CanViewMixin, which are located in core.views. Your view will then be protected using either the
appropriate group fields, or the right method to check user permissions.
#### Counting the number of line of code
```bash
sudo apt install cloc
cloc --exclude-dir=doc,env .
```
#### Updating doc/SYNTAX.md
If you make an update in the Markdown syntax parser, it's good to document
update the syntax reference page in `doc/SYNTAX.md`. But updating this file will
break the tests if you don't update the corresponding `doc/SYNTAX.html` file at
the same time.
To do that, simply run `./manage.py markdown > doc/SYNTAX.html`,
and the tests should pass again.
#### If you want to contribute, here's how we recommend to read the docs:
* First, it's advised to read the about part of the project to understand the goals and the mindset of the current and previous maintainers and know what to expect to learn.
* If in the first part you realize that you need more background about what we use, we provide some links to tutorials and documentation at the end of our documentation. Feel free to use it and complete it with what you found helpful.
* Keep in mind that this documentation is thought to be read in order.
> This project is licensed under GNU GPL, see the LICENSE file at the top of the repository for more details.
{%trans%}Warning: this operation has no linked operation because the targeted club account has no opened journal.{%endtrans%}
</strong></p>
<p><strong>
{%transurl=o.target.get_absolute_url()%}Open a journal in <a href="{{url}}">this club account</a>, then save this operation again to make the linked operation.{%endtrans%}
<strong>{%trans%}Warning: if you select <em>Account</em>, the opposite operation will be created in the target account. If you don't want that, select <em>Club</em> instead of <em>Account</em>.{%endtrans%}</strong>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.