Miroir du site de l'AE UTBM https://ae.utbm.fr
Go to file
2019-10-07 23:51:37 +02:00
accounting small fix to follow python recommendations 2019-02-02 00:32:34 +01:00
api All: Apply Black coding rules 2018-10-05 21:52:55 +02:00
club club: fix SellingFormBase import 2019-05-21 10:53:18 +02:00
com com: fix error 500 when editing poster with com admin 2019-10-02 15:32:33 +02:00
core documentation fix tests because of missing README.md 2019-10-07 23:51:37 +02:00
counter Merge branch 'counter' into 'master' 2019-09-20 14:03:07 +02:00
doc documentation: add explanation on MVT and explain project structure 2019-10-07 23:51:37 +02:00
eboutic eboutic: add some help and documentation for the payment system 2019-05-27 11:20:57 +02:00
election elections: use MarkdownInput for CandidateForm 2018-12-20 16:43:59 +01:00
forum forum: enhance performances on toggle_favorite 2019-09-15 16:12:24 +02:00
launderette All: Apply Black coding rules 2018-10-05 21:52:55 +02:00
locale/fr/LC_MESSAGES core: fix error 500 with expired reset password links 2019-09-10 16:56:58 +02:00
matmat All: Apply Black coding rules 2018-10-05 21:52:55 +02:00
pedagogy pedagogy: add script to remove all previous doubled comments 2019-09-04 20:49:18 +02:00
rootplace rootplace: make code clearer and fix typos 2019-03-19 17:23:02 +01:00
sas sas: add cache on Picture permissions to avoid hitting the bdd too much 2019-09-16 11:33:32 +02:00
sith documentation: base structure for new documentation 2019-10-07 23:51:35 +02:00
stock All: Apply Black coding rules 2018-10-05 21:52:55 +02:00
subscription SUBSCRIPTIONS: 5 new discounted subscriptions for integration 2019-08-29 19:06:58 +02:00
trombi trombi: permissions fixs 2019-10-02 14:56:04 +02:00
.coveragerc coverage: blacklist some files 2017-09-07 11:50:05 +02:00
.gitattributes Add mappings for .po and .jinja files 2019-04-22 18:20:22 +02:00
.gitignore documentation: base structure for new documentation 2019-10-07 23:51:35 +02:00
.gitlab-ci.yml ci: fix building of pygraphviz 2019-07-15 14:29:47 +02:00
.readthedocs.yml documentation: base structure for new documentation 2019-10-07 23:51:35 +02:00
LICENSE Apply GPLv3 to Sith, and add header to every concerned file 2017-04-24 17:51:12 +02:00
LICENSE.old Apply GPLv3 to Sith, and add header to every concerned file 2017-04-24 17:51:12 +02:00
manage.py Apply GPLv3 to Sith, and add header to every concerned file 2017-04-24 17:51:12 +02:00
migrate.py pedagogy: fix typo for AUTUMN_AND_SPRING 2019-07-05 16:40:02 +02:00
README.rst documentation: update instructions, add down loadable files and add all pdf reports for download purpose 2019-10-07 23:51:36 +02:00
requirements.txt documentation: installation instructions 2019-10-07 23:51:36 +02:00
TODO.md Add basic refill support 2016-06-26 20:07:29 +02:00

.. image:: https://ae-dev.utbm.fr/ae/Sith/badges/master/pipeline.svg
  :target: https://ae-dev.utbm.fr/ae/Sith/commits/master
  :alt: pipeline status

.. image:: https://ae-dev.utbm.fr/ae/Sith/badges/master/coverage.svg
  :target: https://ae-dev.utbm.fr/ae/Sith/commits/master
  :alt: coverage report

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
  :target: https://github.com/ambv/black
  :alt: code style: black

.. image:: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
  :target: https://ae-dev.zulipchat.com
  :alt: project chat

.. image:: https://readthedocs.org/projects/sith-ae/badge/?version=latest
  :target: https://sith-ae.readthedocs.io/?badge=latest
  :alt: documentation Status

.. body

.. role:: bash(code)
   :language: bash

Sith AE
=======

| **Website** is available here https://ae.utbm.fr/.
| **Documentation** is available here https://sith-ae.readthedocs.io/.

| Please contact us at mailto:ae.info@utbm.fr if you have issues while using our website.
| If you want to join us, you can join our Zulip chat at https://ae-dev.zulipchat.com.

This project is licenced under GNU GPL, see the LICENSE file at the top of the repository for more details.

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

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 :

.. sourcecode:: 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 :bash:`is_owned_by(self, user)`, a :bash:`can_be_edited_by(self, user)`, and/or a :bash:`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 :bash:`owner_group` field, as a ForeignKey to Group.  Second is an :bash:`edit_groups` field, as a ManyToMany to Group, and third is a :bash:`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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. sourcecode:: 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 :bash:`doc/SYNTAX.md`. But updating this file will break the tests if you don't update the corresponding :bash:`doc/SYNTAX.html` file at the same time.
| To do that, simply run :bash:`./manage.py markdown > doc/SYNTAX.html`,
and the tests should pass again.