mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-02-23 00:21:19 +00:00
Compare commits
24 Commits
d7a537b6b5
...
3eed93e346
Author | SHA1 | Date | |
---|---|---|---|
|
3eed93e346 | ||
|
4da523a1ba | ||
|
e74ff54468 | ||
|
2e49c9ffbd | ||
|
d20a1038a8 | ||
|
f6b711bb1b | ||
|
893d87a9e1 | ||
|
9f3323c73e | ||
|
c57f81b920 | ||
|
0636d84286 | ||
|
ed06901fae | ||
|
28932f316b | ||
|
9b50ba722c | ||
|
3e3e61d23f | ||
|
1129815ca3 | ||
|
c13172d3ff | ||
|
fcc4121225 | ||
|
a06f355559 | ||
|
08df5fcccd | ||
|
b6c0f9758d | ||
|
a23093851f | ||
d5a9bf175f | |||
|
d803ab5ec2 | ||
b597a6ac5b |
3
.ansible-lint
Normal file
3
.ansible-lint
Normal file
@ -0,0 +1,3 @@
|
||||
skip_list:
|
||||
- command-instead-of-shell # Use shell only when shell functionality is required
|
||||
- experimental # all rules tagged as experimental
|
@ -36,6 +36,20 @@ linters:
|
||||
# Be nice to new contributors, but please use `tox`
|
||||
allow_failure: true
|
||||
|
||||
# Ansible linter
|
||||
ansible-linter:
|
||||
stage: quality-assurance
|
||||
image: otthorn/nk20_ci_ansiblelint
|
||||
script: ansible-lint ansible/
|
||||
|
||||
# Docker linter
|
||||
docker-linter:
|
||||
stage: quality-assurance
|
||||
image: hadolint/hadolint
|
||||
script:
|
||||
- hadolint -c .hadolint Dockerfile
|
||||
- hadolint -c .hadolint docker_ci/Dockerfile.*
|
||||
|
||||
# Compile documentation
|
||||
documentation:
|
||||
stage: docs
|
||||
|
4
.hadolint
Normal file
4
.hadolint
Normal file
@ -0,0 +1,4 @@
|
||||
ignored:
|
||||
- DL3008 # Do not force to pin version in apt (Debian)
|
||||
- DL3013 # Do not force to pin version in pip (PyPI)
|
||||
- DL3018 # Do not force to pin version in apk (Alpine)
|
@ -223,7 +223,8 @@ class Transaction(PolymorphicModel):
|
||||
# Check that the amounts stay between big integer bounds
|
||||
diff_source, diff_dest = self.validate()
|
||||
|
||||
if not self.source.is_active or not self.destination.is_active:
|
||||
if not (hasattr(self, '_force_save') and self._force_save) \
|
||||
and (not self.source.is_active or not self.destination.is_active):
|
||||
raise ValidationError(_("The transaction can't be saved since the source note "
|
||||
"or the destination note is not active."))
|
||||
|
||||
@ -271,7 +272,7 @@ class RecurrentTransaction(Transaction):
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
if self.template.destination != self.destination:
|
||||
if self.template.destination != self.destination and not (hasattr(self, '_force_save') and self._force_save):
|
||||
raise ValidationError(
|
||||
_("The destination of this transaction must equal to the destination of the template."))
|
||||
return super().clean()
|
||||
|
@ -43,4 +43,5 @@ def delete_transaction(instance, **_kwargs):
|
||||
"""
|
||||
if not hasattr(instance, "_no_signal"):
|
||||
instance.valid = False
|
||||
instance._force_save = True
|
||||
instance.save()
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit dbe7bf65917df40b0ce476f357d04726e20b406f
|
||||
Subproject commit 8ec7d68a169c1072aec427925f3bf2fd54eab5a3
|
@ -381,6 +381,11 @@ class SogeCredit(models.Model):
|
||||
tr.valid = True
|
||||
tr.created_at = timezone.now()
|
||||
tr.save()
|
||||
if self.credit_transaction:
|
||||
# If the soge credit is deleted while the user is not validated yet,
|
||||
# there is not credit transaction.
|
||||
# There is a credit transaction iff the user declares that no bank account
|
||||
# was opened after the validation of the account.
|
||||
self.credit_transaction.valid = False
|
||||
self.credit_transaction.reason += " (invalide)"
|
||||
self.credit_transaction.save()
|
||||
|
10
docker_ci/Dockerfile.ansiblelint
Normal file
10
docker_ci/Dockerfile.ansiblelint
Normal file
@ -0,0 +1,10 @@
|
||||
FROM python:3.9-alpine
|
||||
|
||||
LABEL maintainer="otthorn@crans.org"
|
||||
LABEL description="Alpine image with ansible-lint and yamllint \
|
||||
installed for linting purposes"
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev openssl-dev cargo
|
||||
RUN pip install --no-cache-dir "yamllint>=1.26.0,<2.0"
|
||||
RUN pip install --no-cache-dir "ansible-lint==5.0.0"
|
||||
RUN pip install --no-cache-dir "ansible>=2.10,<2.11"
|
8
docker_ci/Dockerfile.tox
Normal file
8
docker_ci/Dockerfile.tox
Normal file
@ -0,0 +1,8 @@
|
||||
FROM alpine:3.13
|
||||
|
||||
LABEL maintainer="otthorn@crans.org"
|
||||
LABEL description="Alpine image with tox \
|
||||
installed for linting purposes"
|
||||
|
||||
RUN apk --no-cache add py3-pip=20.3.4-r0
|
||||
RUN pip install --no-cache-dir tox==3.22.0
|
@ -1,16 +0,0 @@
|
||||
## TODO
|
||||
- Créer les images
|
||||
- Build les images
|
||||
- Push les images sur la docker registery de mon choix (docker hub
|
||||
probablement)
|
||||
- Tester la CI avec les images pré construite pour voir tout fonctionnne comme
|
||||
avant
|
||||
- Créer une CI pour les images docker elle meme (hadolin)
|
||||
- Créer une CI pour les images docker de la note
|
||||
- Créer une CI pour ansible
|
||||
- Créer la MR
|
||||
- Demande de merge de la MR
|
||||
|
||||
## Optionnel
|
||||
- build automatique des images par la CI
|
||||
- utiliser le gitlab registery local une fois qu'il sera activé
|
Loading…
x
Reference in New Issue
Block a user