Rename input variable

This commit is contained in:
Christian Cueni 2020-05-12 11:20:43 +02:00
parent 47129e81a6
commit d159876472
7 changed files with 5 additions and 54 deletions

File diff suppressed because one or more lines are too long

View File

@ -66,7 +66,7 @@ export default {
mutation: REDEEM_COUPON,
variables: {
input: {
couponCodeInput: this.coupon
couponCode: this.coupon
}
},
update(

View File

@ -1,12 +1,3 @@
# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2020 ITerativ GmbH. All rights reserved.
#
# Created on 23.01.20
# @author: chrigu <christian.cueni@iterativ.ch>
from datetime import datetime, timedelta
from django.conf import settings
@ -86,7 +77,6 @@ class HepClient:
return response.json()
def customer_create(self, customer_data):
response = self._call('/rest/deutsch/V1/customers', method='post', data=customer_data)
return response.json()
@ -128,7 +118,7 @@ class HepClient:
def coupon_redeem(self, coupon, customer_id):
try:
response = self._call(f'/rest/deutsch/V1/coupon/{coupon}/customer/{customer_id}', method='put')
except HepClientException as e:
except HepClientException:
return None
response_data = response.json()
@ -228,7 +218,6 @@ class HepClient:
@staticmethod
def is_product_active(expiry_date, edition):
if edition == TEACHER_KEY:
duration = TEACHER_EDITION_DURATION
else:

View File

@ -1,12 +1,3 @@
# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2020 ITerativ GmbH. All rights reserved.
#
# Created on 24.02.20
# @author: chrigu <christian.cueni@iterativ.ch>
import os
import shutil

View File

@ -1,12 +1,3 @@
# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2020 ITerativ GmbH. All rights reserved.
#
# Created on 03.02.20
# @author: chrigu <christian.cueni@iterativ.ch>
from django.conf import settings
from django.db import models
from datetime import timedelta
@ -21,7 +12,6 @@ class AdminDataManager(models.Manager):
hep_client = HepClient()
def update_admin_token(self):
admin_token = self.hep_client.fetch_admin_token(settings.HEP_ADMIN_USER, settings.HEP_ADMIN_PASSWORD)
admin_data, created = self.get_or_create(pk=DEFAULT_PK)
@ -30,7 +20,6 @@ class AdminDataManager(models.Manager):
return admin_data.hep_admin_token
def get_admin_token(self):
try:
admin_token = self.get(pk=DEFAULT_PK)
if admin_token.updated_at < timezone.now() + timedelta(hours=1):

View File

@ -1,12 +1,3 @@
# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2020 ITerativ GmbH. All rights reserved.
#
# Created on 03.02.20
# @author: chrigu <christian.cueni@iterativ.ch>
from datetime import datetime
from django.db import models

View File

@ -1,12 +1,3 @@
# -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2020 ITerativ GmbH. All rights reserved.
#
# Created on 03.02.20
# @author: chrigu <christian.cueni@iterativ.ch>
import graphene
from graphene import relay
@ -16,13 +7,13 @@ from users.user_signup_login_handler import check_and_create_licenses, create_ro
class Coupon(relay.ClientIDMutation):
class Input:
coupon_code_input = graphene.String()
coupon_code = graphene.String()
success = graphene.Boolean()
@classmethod
def mutate_and_get_payload(cls, root, info, **kwargs):
coupon_code = kwargs.get('coupon_code_input').strip()
coupon_code = kwargs.get('coupon_code').strip()
hep_client = HepClient()
try: