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,
|
mutation: REDEEM_COUPON,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
couponCodeInput: this.coupon
|
couponCode: this.coupon
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
update(
|
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 datetime import datetime, timedelta
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
@ -86,7 +77,6 @@ class HepClient:
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
def customer_create(self, customer_data):
|
def customer_create(self, customer_data):
|
||||||
|
|
||||||
response = self._call('/rest/deutsch/V1/customers', method='post', data=customer_data)
|
response = self._call('/rest/deutsch/V1/customers', method='post', data=customer_data)
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
|
|
@ -128,7 +118,7 @@ class HepClient:
|
||||||
def coupon_redeem(self, coupon, customer_id):
|
def coupon_redeem(self, coupon, customer_id):
|
||||||
try:
|
try:
|
||||||
response = self._call(f'/rest/deutsch/V1/coupon/{coupon}/customer/{customer_id}', method='put')
|
response = self._call(f'/rest/deutsch/V1/coupon/{coupon}/customer/{customer_id}', method='put')
|
||||||
except HepClientException as e:
|
except HepClientException:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
response_data = response.json()
|
response_data = response.json()
|
||||||
|
|
@ -228,7 +218,6 @@ class HepClient:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_product_active(expiry_date, edition):
|
def is_product_active(expiry_date, edition):
|
||||||
|
|
||||||
if edition == TEACHER_KEY:
|
if edition == TEACHER_KEY:
|
||||||
duration = TEACHER_EDITION_DURATION
|
duration = TEACHER_EDITION_DURATION
|
||||||
else:
|
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 os
|
||||||
import shutil
|
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.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
@ -21,7 +12,6 @@ class AdminDataManager(models.Manager):
|
||||||
hep_client = HepClient()
|
hep_client = HepClient()
|
||||||
|
|
||||||
def update_admin_token(self):
|
def update_admin_token(self):
|
||||||
|
|
||||||
admin_token = self.hep_client.fetch_admin_token(settings.HEP_ADMIN_USER, settings.HEP_ADMIN_PASSWORD)
|
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)
|
admin_data, created = self.get_or_create(pk=DEFAULT_PK)
|
||||||
|
|
@ -30,7 +20,6 @@ class AdminDataManager(models.Manager):
|
||||||
return admin_data.hep_admin_token
|
return admin_data.hep_admin_token
|
||||||
|
|
||||||
def get_admin_token(self):
|
def get_admin_token(self):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
admin_token = self.get(pk=DEFAULT_PK)
|
admin_token = self.get(pk=DEFAULT_PK)
|
||||||
if admin_token.updated_at < timezone.now() + timedelta(hours=1):
|
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 datetime import datetime
|
||||||
|
|
||||||
from django.db import models
|
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
|
import graphene
|
||||||
from graphene import relay
|
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 Coupon(relay.ClientIDMutation):
|
||||||
class Input:
|
class Input:
|
||||||
coupon_code_input = graphene.String()
|
coupon_code = graphene.String()
|
||||||
|
|
||||||
success = graphene.Boolean()
|
success = graphene.Boolean()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, root, info, **kwargs):
|
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()
|
hep_client = HepClient()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue