This fixes#607 and add a test case for this bug.
It also renames participants in test cases to avoid alphabetical ordering.
Inserting participants in alphabetical order is a special case, because ordering by ID will be the same as ordering by name. This is a bad idea in test cases, as #607 has shown.
Now each project can have a currency, default to None.
Each bill can use a different currency, and a conversion to project default currency is done on settle.
Fix#512
Currently the string representation of a Bill is: "<amount> for <description>"
It is used in the History Page to describe changes that were applied to
Bills, for instance:
Bill "42.0 for Test" renamed to "Another Test"
This is inconsistent, not easy to read, and the "for" in the middle is not
translatable.
To solve this issue, simply switch the string representation of a bill to
its description.
Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
* Direct Alembic to ignore the sqlite_sequence table
* Direct Alembic to ignore the sqlite_sequence table
* Fix "Skipping unsupported ALTER" warning on database migration
* Fix user-facing string and update translation catalog
In the flash message confirming member creation, change "member had been
added" into the correct form "member has been added".
No translation has been changed. Some translators seem to have already
spotted the mistake while translating, but I can't tell for all languages.
* Change "Person" to "Participant" in history view
Currently, the main user-facing term is "Participant", as seen for
instance in the "Add participant" form. "Person" is not used anywhere in
the interface.
See #302 for a more general discussion on choosing the right terminology.
* Fix obsolete translations.
Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
According to https://hosted.weblate.org/projects/i-hate-money/i-hate-money/
these translations are almost complete (69% and 58% currently, but that's
because there have been lots of new strings to translate recently)
Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
Co-Authored-By: Glandos <bugs-github@antipoul.fr>
All project activity can be tracked, using SQLAlchemy-continuum.
IP addresses can optionally be recorded.
* Added DataTables for table sorting, pagination, and searching of bill_table for dashboard. Issue #112
* Moved datatables CSS/JS to dashboard to reduce loaded data throughout
* Moved link back to proper place, in head tab, but added if to prevent loading CSS/JS for datatables outside of the dashboard. Also added eye icon to drill into list_billa API to be more consistent with the look and feel of the overall site.
Co-authored-by: bmatt <bmatt@nuc01.attlocal.net>
* Align tables in statistics
The table in sidebar is now aligned with the one in content, to avoid
redundant informations.
All tables are back to normal on small devices.
* fix test
* run black on tests
* Added support for multiple API versions
Note that no changes were made to the api, the code was refactored to allow for new versions of the api to be created down the road.
Here's what this would look like:
+-- api/
+-- v1/
+-- __init__.py
+-- resources.py
+-- v1_1/
+-- __init__.py
+-- resources.py
+-- v2/
+-- __init__.py
+-- resources.py
+-- __init__.py
+-- common.py
* reformatted using black
/Users/drthrash/PycharmProjects/ihatemoney/ihatemoney/api/v1/resources.py
reformatted /Users/drthrash/PycharmProjects/ihatemoney/ihatemoney/api/common.py
All done! ✨🍰✨
* Applying fix for unused import in init.py
https://stackoverflow.com/questions/31079047/python-pep8-class-in-init-imported-but-not-used
* Formatting changes recommended by black
All done! ✨🍰✨
1 file reformatted, 22 files left unchanged.
* Update models: Bill.pay_each()
* Import sql func
* reformatted using black
* Added ModelsTestCase.test_bill_pay_each() in order to test the SQL query change within pay_each.
Had to add Project.ProjectQuery.get_by_name() for the test.
* Added translation using Weblate (Indonesian)
* Translated using Weblate (Indonesian)
Currently translated at 100.0% (158 of 158 strings)
Translation: I Hate Money/I Hate Money
Translate-URL: https://hosted.weblate.org/projects/i-hate-money/i-hate-money/id/
* Added translation using Weblate (Ukrainian)
* Translated using Weblate (Ukrainian)
Currently translated at 11.4% (18 of 158 strings)
Translation: I Hate Money/I Hate Money
Translate-URL: https://hosted.weblate.org/projects/i-hate-money/i-hate-money/uk/
* Translated using Weblate (Chinese (Simplified))
Currently translated at 20.9% (33 of 158 strings)
Translation: I Hate Money/I Hate Money
Translate-URL: https://hosted.weblate.org/projects/i-hate-money/i-hate-money/zh_Hans/
* Translated using Weblate (German)
Currently translated at 100.0% (155 of 155 strings)
Translation: I Hate Money/I Hate Money
Translate-URL: https://hosted.weblate.org/projects/i-hate-money/i-hate-money/de/
Co-authored-by: Muhammad Fauzi <fauzipadlaw@users.noreply.github.com>
Co-authored-by: Muge Niu <mugeniu12138@gmail.com>
Co-authored-by: flolilo <30194876+flolilo@users.noreply.github.com>
Fix#417
* New tab upload
* Extract data from JSON
* Add users
* Black format
* Try to add bill
* Import bills
* Add french translation msg
* Black reformat missing
* Deactivated users are supported
* Test import
* Remove temp file in upload_json()
* Incomplete tests
* tests import
* Update ihatemoney/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com>
* Remove useless variable and check json format
* Use String.IO and test for wrong json
* Remove coma
Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
An optional field has been added to the bill form to add a link to a real bill. A new action button allow user to see this bill. Breaking change with Bill model update for database, a migration is needed.
See issue #429.
Create a new route with a new generic page that display a title and a message on a <p> tag. This route will be triggered after succesfully submit password reminder form
See issue #455
- add buttons class to fix alignments
- add responsive info to big tables
- use visibility instead of display to avoid jumping rows
- reorganize menu in responsive
Flake8 was nitpicking about:
ihatemoney/forms.py:192:13: F841 local variable 'e' is assigned to but never used
ihatemoney/utils.py:26:8: W605 invalid escape sequence '\w'
ihatemoney/utils.py:26:10: W605 invalid escape sequence '\s'
ihatemoney/utils.py:27:8: W605 invalid escape sequence '\s'
When double-clicking on the delete button, the first click actually
deletes the bill, and the second click does the same action again. But
as the bill is already deleted, it displays a 404 page which can be
misleading.
This fix makes the app trigger a redirect when the bill seem to doesn't
exist, fixing this strange behaviour.
* Add a `make update-translations` command
To collect new strings to be translated from code.
Totally cheated on @Glandos commands :-)
Ref #336
Ref https://github.com/spiral-project/ihatemoney/issues/336#issue-322069517
* Document translation process
Fix#336
* Drop noisy location comments from .po files
Fix#339
* Drop .pot header
As it serves no purpose with our translation workflow.
.po header could be removed also, but pybabel has no option for that.
Ref #339
I don't know why, but on my setup (nginx + uwsgi), the `strict_slashes` (default to `True`) was causing an infinite loop.
I think it could be safely removed for this route only.
Clearer data structure, and simpler template
This commit has a side effect: sidebar now hides disabled members.
IMHO, the disabled members should either be hidden or shown consistently between
sidebar and central table. Previous status was: shown in sidebar (if balance ≠
0) and hidden in central table.
This fix a regression from #316 (scrollbar was displayed all the time).
Note that the padding-bottom value is totally empiric, but proved OK on my Fx
and Chrome instances + some responsive tests. There might be finer solutions,
feel free :-).
For this I had to create an Jinja2 explicit environment, so I put a
function in `ihatemoney.utils.create_jinja2_env(strict_rendering=False)`.
When using this environment and if `strict_rendering` is activated,
templates using undefined variables will now error out rather than
failing silently.
The script was relying on the presence of an environment variable, which
is only set when the virtualenv is activated. But a virtualenv does not
have to be activated to work (it's possible to call the python command
directly).
This fixes it by relying on `sys.executable` which should be correct at
all times.
Fixes#306
* Rename manage.ConfigTemplate → manage.GenerateConfig
To be consistent with the CLI name: `generate-config`.
* Add tests for manage.py commands
* Run tests from pip-installed package
To be able to detect packaging-related issues on test runs.
refs #305
The script was relying on the presence of an environment variable, which
is only set when the virtualenv is activated. But a virtualenv does not
have to be activated to work (it's possible to call the python command
directly).
This fixes it by relying on `sys.executable` which should be correct at
all times.
Fixes#306
I've also renamed the templates to *.j2 in order to make things clearer
to others. Having extensions with the name of the locale doesn't seem to
be a good practice, and would need us to add the locales in the MANIFEST
file each time we add one.
Fix#305
* Enable basic auth passthrough for API
Added the couple of apache configuration lines necessary to get the basic authentication working for the API.
* Revert the addition of "AuthType Basic"
Did some more testing on my server here and I totally agree, don't need "AuthType Basic".
* Fix PUT api/project/:code/members/:id
Before that commit, every PUT *must* change the name of the members, so that was :
- no idempotence,
- no ability to change only weight
fix#295
* Remove redundant comment
* Use token based auth in invitation e-mails
Invitation e-mails no longer contain the clear
text project password
* Skip invite page after project creation
- Replace ``The project identifier is demo, remember it!``
by ``Invite other people to join this project!``
(linking to the invite page)
- Encourage users to share the project password via other
communication means in the reminder email
* Fixed exposed password in session
The project password was set in clear text
in the session cookie. The cookie payload is
only base64 encoded so it must not be used to
store private information. The password is
simply replaced by a boolean.
* Simplify authentication logic
* Add a command to generate configuration examples
Config files are generated from templates (which remplace previous example files).
- solve the issue of hard-to-explain configuration examples
- ease pkg path seeking (avoid it, actually)
- add working defaults for sqlite and unix socket paths (instead of
/replace/me/path/example)
- move settings comments from default_settings.py to ihatemoney.cfg.j2, as it is
the one that will be facing user.
* Use generate-config command in install doc
Also follow the new working defaults of templates for socket and db path.
* Fix doc settings table
On the long term, plaintext tables might destroy humanity.
* Mention templates dir URL in documentation
As requested by @almet
* Update to a more flexible admin authentication
* Admin can now access any project
* Add delete and edit options in the dashboard
* Add a link to the dashboard in the nav bar
This is a rework of the changes proposed by @Olivd, so they can apply on top of
the latest master without trouble. All credit goes to him for the code.
* Protect admin endpoints against brute force attacks
Add a throttling mechanism to prevent a client brute
forcing the authentication form, based on its ip address
Closes#245
* Reset attempt counters if they get memory hungry
Bootstrap-datepicker is only included in the
list_bills template but its configuration was
living in the layout template, leading to a
javascript error on every page except list_bills.
Fixes#256
In flask's development server, the route handlers
run in a different thread than the main thread
thus an in-memory database created in the main thread
cannot be acccessed by the route handlers.
Switching the default database location to a temporary
file solves the isssue.
See full explanation here:
https://gehrcke.de/2015/05/in-memory-sqlite-database-and-flask-a-threading-trap/
* Use absolute imports and rename package to ihatemoney
* Add a ihatemoney command
* Factorize application creation logic
* Refactor the tests
* Update the wsgi.py module with the new create_app() function
* Fix some styling thanks to Flake8.
* Automate Flake8 check in the CI.