Skip to content

Commit

Permalink
fix: fixing black
Browse files Browse the repository at this point in the history
  • Loading branch information
roniahmadi committed Feb 28, 2024
1 parent 5b2a340 commit afef1e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
11 changes: 5 additions & 6 deletions frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def get(self, request, id):
postdata = requests.post(
"https://api.minepi.com/v2/payments/" + id + "/approve",
headers=header,
timeout=5000
timeout=5000,
)
if postdata.status_code == 200:
return JsonResponse(postdata.json())
Expand Down Expand Up @@ -555,7 +555,7 @@ def get(self, request, id):
"https://api.minepi.com/v2/payments/" + id + "/complete",
data=datas,
headers={"Authorization": "Key " + api_key},
timeout=5000
timeout=5000,
)
if postdata.status_code == 200:
cart = Cart.objects.get(pk=request.GET.get("id"))
Expand All @@ -580,7 +580,7 @@ def get(self, request, id):
cancel = requests.get(
"https://api.minepi.com/payments/" + id + "/cancel",
headers={"Authorization": "Key " + api_key},
timeout=5000
timeout=5000,
)
print(cancel.json())
return JsonResponse(cancel, safe=False)
Expand Down Expand Up @@ -637,7 +637,7 @@ def setcomplete(self, request, cart_id, identifier, param):
"https://api.minepi.com/v2/payments/" + identifier + "/complete",
data=datas,
headers={"Authorization": "Key " + api_key},
timeout=5000
timeout=5000,
)

if postdata.status_code == 200:
Expand All @@ -664,8 +664,7 @@ def get(self, request, param):

data_url = "https://api.minepi.com/v2/payments/" + param
requestdata = requests.get(
data_url, headers={"Authorization": "Key " + api_key},
timeout=5000
data_url, headers={"Authorization": "Key " + api_key}, timeout=5000
)

cart_id = request.GET.get("cart_id")
Expand Down
12 changes: 9 additions & 3 deletions projekpi/pi_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def create_payment(self, payment_data):

obj = json.dumps(obj)
url = self.base_url + "/v2/payments"
re = requests.post(url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000)
re = requests.post(
url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000
)
parsed_response = self.handle_http_response(re)

identifier = parsed_response["identifier"]
Expand Down Expand Up @@ -149,14 +151,18 @@ def complete_payment(self, identifier, txid):

obj = json.dumps(obj)
url = self.base_url + "/v2/payments/" + identifier + "/complete"
re = requests.post(url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000)
re = requests.post(
url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000
)
self.handle_http_response(re)

def cancel_payment(self, identifier):
obj = {}
obj = json.dumps(obj)
url = self.base_url + "/v2/payments/" + identifier + "/cancel"
re = requests.post(url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000)
re = requests.post(
url, data=obj, json=obj, headers=self.get_http_headers(), timeout=10000
)
self.handle_http_response(re)

def cancel_payment_user(self, identifier):
Expand Down
10 changes: 5 additions & 5 deletions projekpi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS',False)
EMAIL_HOST = os.getenv("EMAIL_HOST",'geraipi')
EMAIL_PORT = os.getenv("EMAIL_PORT",465)
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", False)
EMAIL_HOST = os.getenv("EMAIL_HOST", "geraipi")
EMAIL_PORT = os.getenv("EMAIL_PORT", 465)
EMAIL_USE_SSL = True
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER",'[email protected]')
EMAIL_HOST_PASSWORD = ("EMAIL_HOST_PASSWORD",'geraipi')
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "[email protected]")
EMAIL_HOST_PASSWORD = ("EMAIL_HOST_PASSWORD", "geraipi")

CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_FILENAME_GENERATOR = "utils.get_filename"
Expand Down

0 comments on commit afef1e2

Please sign in to comment.