mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-29 20:51:11 +02:00
Linting
This commit is contained in:
@ -8,7 +8,6 @@ from django.contrib.auth import logout
|
|||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.auth.views import LoginView
|
from django.contrib.auth.views import LoginView
|
||||||
from django.contrib.contenttypes.models import ContentType
|
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
from django.db.models import Q, F
|
from django.db.models import Q, F
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
|
@ -325,8 +325,8 @@ class SpecialTransaction(Transaction):
|
|||||||
def clean(self):
|
def clean(self):
|
||||||
# SpecialTransaction are only possible with NoteSpecial object
|
# SpecialTransaction are only possible with NoteSpecial object
|
||||||
if self.is_credit() == self.is_debit():
|
if self.is_credit() == self.is_debit():
|
||||||
raise(ValidationError(_("A special transaction is only possible between a"
|
raise (ValidationError(_("A special transaction is only possible between a"
|
||||||
" Note associated to a payment method and a User or a Club")))
|
" Note associated to a payment method and a User or a Club")))
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
@ -172,6 +172,7 @@ class TrustTable(tables.Table):
|
|||||||
else '')}},
|
else '')}},
|
||||||
verbose_name=_("Delete"),)
|
verbose_name=_("Delete"),)
|
||||||
|
|
||||||
|
|
||||||
class TrustedTable(tables.Table):
|
class TrustedTable(tables.Table):
|
||||||
class Meta:
|
class Meta:
|
||||||
attrs = {
|
attrs = {
|
||||||
@ -184,7 +185,7 @@ class TrustedTable(tables.Table):
|
|||||||
|
|
||||||
show_header = False
|
show_header = False
|
||||||
trusting = tables.Column(attrs={
|
trusting = tables.Column(attrs={
|
||||||
'td': {'class': 'text-center', 'width':'100%'}})
|
'td': {'class': 'text-center', 'width': '100%'}})
|
||||||
|
|
||||||
trust_back = tables.Column(
|
trust_back = tables.Column(
|
||||||
verbose_name=_("Trust back"),
|
verbose_name=_("Trust back"),
|
||||||
@ -200,7 +201,7 @@ class TrustedTable(tables.Table):
|
|||||||
def render_trust_back(self, record):
|
def render_trust_back(self, record):
|
||||||
user_note = record.trusted
|
user_note = record.trusted
|
||||||
trusting_note = record.trusting
|
trusting_note = record.trusting
|
||||||
if Trust.objects.filter(trusted=trusting_note, trusting=user_note) :
|
if Trust.objects.filter(trusted=trusting_note, trusting=user_note):
|
||||||
return ""
|
return ""
|
||||||
val = '<button id="'
|
val = '<button id="'
|
||||||
val += str(record.pk)
|
val += str(record.pk)
|
||||||
|
@ -324,23 +324,23 @@ class SogeCredit(models.Model):
|
|||||||
if self.valid or not self.pk:
|
if self.valid or not self.pk:
|
||||||
return
|
return
|
||||||
|
|
||||||
bde = Club.objects.get(name="BDE")
|
# bde = Club.objects.get(name="BDE")
|
||||||
kfet = Club.objects.get(name="Kfet")
|
# kfet = Club.objects.get(name="Kfet")
|
||||||
bde_qs = Membership.objects.filter(user=self.user, club=bde, date_start__gte=bde.membership_start)
|
# bde_qs = Membership.objects.filter(user=self.user, club=bde, date_start__gte=bde.membership_start)
|
||||||
kfet_qs = Membership.objects.filter(user=self.user, club=kfet, date_start__gte=kfet.membership_start)
|
# kfet_qs = Membership.objects.filter(user=self.user, club=kfet, date_start__gte=kfet.membership_start)
|
||||||
|
|
||||||
## Soge do not pay BDE and kfet memberships this year (2022-2023)
|
# # Soge do not pay BDE and kfet memberships this year (2022-2023)
|
||||||
# if bde_qs.exists():
|
# if bde_qs.exists():
|
||||||
# m = bde_qs.get()
|
# m = bde_qs.get()
|
||||||
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
||||||
# if m.transaction not in self.transactions.all():
|
# if m.transaction not in self.transactions.all():
|
||||||
# self.transactions.add(m.transaction)
|
# self.transactions.add(m.transaction)
|
||||||
#
|
#
|
||||||
# if kfet_qs.exists():
|
# if kfet_qs.exists():
|
||||||
# m = kfet_qs.get()
|
# m = kfet_qs.get()
|
||||||
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
# if MembershipTransaction.objects.filter(membership=m).exists(): # non-free membership
|
||||||
# if m.transaction not in self.transactions.all():
|
# if m.transaction not in self.transactions.all():
|
||||||
# self.transactions.add(m.transaction)
|
# self.transactions.add(m.transaction)
|
||||||
|
|
||||||
if 'wei' in settings.INSTALLED_APPS:
|
if 'wei' in settings.INSTALLED_APPS:
|
||||||
from wei.models import WEIClub
|
from wei.models import WEIClub
|
||||||
|
Reference in New Issue
Block a user