Rename input variable
This commit is contained in:
parent
47129e81a6
commit
d159876472
File diff suppressed because one or more lines are too long
|
|
@ -66,7 +66,7 @@ export default {
|
|||
mutation: REDEEM_COUPON,
|
||||
variables: {
|
||||
input: {
|
||||
couponCodeInput: this.coupon
|
||||
couponCode: this.coupon
|
||||
}
|
||||
},
|
||||
update(
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue