· 7 years ago · May 22, 2018, 08:24 PM
1kai@ASCUE68-42:~/dev/el/requester$ git branch
2 calc
3* development
4 docs
5 is_leasing
6 issues-261
7 issues-296
8 issues-303
9 issues-305
10 issues-307
11 issues-308
12 issues-313
13 local
14 template
15kai@ASCUE68-42:~/dev/el/requester$ git diff local
16diff --git a/requester/apps/contracts/calculations/payments.py b/requester/apps/contracts/calculations/payments.py
17index ddb43da..f8ae9d6 100644
18--- a/requester/apps/contracts/calculations/payments.py
19+++ b/requester/apps/contracts/calculations/payments.py
20@@ -163,14 +163,11 @@ def calculate_payments(amount, term, rate, payment_cls, redemption_price_rate,
21 date_start=None, first_payment_after=None,
22 min_term=None, rate_vat=VAT_RATE, is_leasing=False):
23
24- if term < min_term:
25- last_payment_cls = type(
26- str('{}LastPayment'.format(payment_cls.__name__)),
27- (LastPaymentMixin, payment_cls),
28- {}
29- )
30- else:
31- last_payment_cls = payment_cls
32+ last_payment_cls = type(
33+ str('{}LastPayment'.format(payment_cls.__name__)),
34+ (LastPaymentMixin, payment_cls),
35+ {}
36+ )
37
38 payment = payment_cls(term, rate, amount, redemption_price_rate, rate_vat=rate_vat)
39 payments_count = int(round(float(amount) / (payment.body + payment.vat)))
40diff --git a/requester/settings/defaults.py b/requester/settings/defaults.py
41index 5cda9b9..af913c6 100644
42--- a/requester/settings/defaults.py
43+++ b/requester/settings/defaults.py
44@@ -13,9 +13,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
45 """
46
47 import os
48-import sys
49 from os.path import abspath, basename, dirname, join, normpath
50-from decouple import config
51
52 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
53 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
54@@ -25,18 +23,14 @@ UPLOAD_DIR = 'uploads'
55 # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
56
57-SECRET_KEY = config('SECRET_KEY')
58+SECRET_KEY = '$dg=2gu2=srw@aeqt$d%=h(8%dhne_64gbc8(#il)s6noxio#2'
59
60 # SECURITY WARNING: don't run with debug turned on in production!
61 DEBUG = True
62
63 PROJECT_NAME = basename(BASE_DIR)
64
65-LOG_DIR = config('LOG_DIR')
66-
67-DEBUG_LOG_FILE = join(LOG_DIR, 'debug.log')
68-
69-sys.path.insert(0, join(BASE_DIR, 'apps'))
70+APPS_ROOT = join(BASE_DIR, 'apps')
71
72 # Application definition
73 INSTALLED_APPS = [
74@@ -148,10 +142,10 @@ AUTH_PASSWORD_VALIDATORS = [
75 },
76 ]
77
78-if not os.path.exists(DEBUG_LOG_FILE):
79- if not os.path.exists(LOG_DIR):
80- os.makedirs(LOG_DIR)
81- open(DEBUG_LOG_FILE, 'a').close()
82+if not os.path.exists('/var/log/requester/debug.log'):
83+ if not os.path.exists('/var/log/requester'):
84+ os.makedirs('/var/log/requester')
85+ open('/var/log/requester/debug.log', 'a').close()
86
87 LOGGING = {
88 'disable_existing_loggers': False,
89@@ -171,7 +165,7 @@ LOGGING = {
90 'file': {
91 'level': 'INFO',
92 'class': 'logging.FileHandler',
93- 'filename': DEBUG_LOG_FILE,
94+ 'filename': '/var/log/requester/debug.log',
95 'formatter': 'verbose'
96 },
97 },
98@@ -205,7 +199,6 @@ USE_I18N = True
99
100 USE_TZ = True
101
102-ALLOWED_HOSTS = ('*',)
103
104 # Static files (CSS, JavaScript, Images)
105 # https://docs.djangoproject.com/en/1.11/howto/static-files/
106diff --git a/requirements.txt b/requirements.txt
107index f890df8..7099948 100644
108--- a/requirements.txt
109+++ b/requirements.txt
110@@ -11,7 +11,6 @@ PyYAML==3.12
111 six==1.10.0
112 django-model-utils==3.0.0
113 django-bootstrap-dynamic-formsets==0.5.0
114-python-decouple==3.1
115 docxtpl==0.3.4
116 numpy==1.13.3
117 redis==2.10.6
118(END)