fix pylint-django warnings
This commit is contained in:
parent
e3b1f83d55
commit
08159a39be
|
@ -17,13 +17,15 @@
|
|||
import taggit.admin
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME, get_user_model
|
||||
from django.contrib.auth.admin import GroupAdmin, UserAdmin
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.models import Group
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.http import urlencode
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
class EOGestionAdminSite(admin.AdminSite):
|
||||
@never_cache
|
||||
|
|
|
@ -118,14 +118,14 @@ class DuplicateContractForm(forms.Form):
|
|||
|
||||
class LigneForm(forms.ModelForm):
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Ligne
|
||||
localized_fields = ("quantite", "prix_unitaire_ht", "taux_tva")
|
||||
|
||||
|
||||
class PrestationForm(forms.ModelForm):
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Prestation
|
||||
localized_fields = ("quantite", "prix_unitaire_ht")
|
||||
|
||||
|
@ -181,14 +181,14 @@ class FactureForm(forms.ModelForm):
|
|||
)
|
||||
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Facture
|
||||
localized_fields = ("taux_tva",)
|
||||
|
||||
|
||||
class ClientForm(forms.ModelForm):
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Client
|
||||
localized_fields = ("tva",)
|
||||
widgets = {
|
||||
|
@ -199,13 +199,13 @@ class ClientForm(forms.ModelForm):
|
|||
|
||||
class ContratForm(forms.ModelForm):
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Contrat
|
||||
localized_fields = ("tva", "montant_sous_traite")
|
||||
|
||||
|
||||
class PaymentForm(forms.ModelForm):
|
||||
class Meta:
|
||||
exclude = ()
|
||||
fields = '__all__'
|
||||
model = models.Payment
|
||||
localized_fields = ("montant_affecte",)
|
||||
|
|
|
@ -20,7 +20,7 @@ from collections import defaultdict
|
|||
from decimal import ROUND_HALF_UP, Decimal
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import RegexValidator, validate_email
|
||||
from django.db import models
|
||||
|
@ -37,6 +37,8 @@ from eo_gestion.utils import percentage_str
|
|||
from ..eo_banque import models as banque_models
|
||||
from . import facturx, fields, taggit, validators
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
validate_telephone = RegexValidator(r"[. 0-9]*")
|
||||
|
||||
DEFAULT_TVA = getattr(settings, "TVA", "20")
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os.path
|
||||
|
||||
|
@ -78,7 +77,7 @@ def api_references(request):
|
|||
)
|
||||
if contract.image:
|
||||
data[-1]['image'] = request.build_absolute_uri(contract.image.url)
|
||||
return http.HttpResponse(json.dumps({'data': data}), content_type='application/json')
|
||||
return http.JsonResponse({'data': data})
|
||||
|
||||
|
||||
def send_to_chorus(request, facture_id):
|
||||
|
|
|
@ -16,9 +16,11 @@
|
|||
|
||||
import django_webtest
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.management import call_command
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
DATA = ["tests/fixture.json"]
|
||||
|
||||
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
|
||||
from datetime import date, timedelta
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from eo_gestion.eo_facture.forms import FactureForm
|
||||
from eo_gestion.eo_facture.models import Client, Contrat
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
def test_facture_form(db, freezer):
|
||||
freezer.move_to('2019-01-01')
|
||||
|
|
Loading…
Reference in New Issue