| @@ -60,15 +60,15 @@ def decrypt(request): | ||
| 60 | 60 |  | 
| 61 | 61 | # brand_id#model_id#distributor_id#sn#time | 
| 62 | 62 | # AAAA#AAAAAA#AAAAA#AAAAAAAAAAAAAA#180224 | 
| 63 | -    brand_id, model_id, distributor_id, sn, time = plaintext.split('#') | |
| 63 | +    brand_pk, model_pk, distributor_pk, sn, time = plaintext.split('#') | |
| 64 | 64 |  | 
| 65 | 65 | try: | 
| 66 | - logo_url = BrandInfo.objects.get(brand_id=brand_id).brand_logo_url | |
| 66 | + logo_url = BrandInfo.objects.get(pk=brand_pk).brand_logo_url | |
| 67 | 67 | except BrandInfo.DoesNotExist: | 
| 68 | 68 | logo_url = '' | 
| 69 | 69 |  | 
| 70 | 70 | try: | 
| 71 | - model_imgs = ModelInfo.objects.get(model_id=model_id).images | |
| 71 | + model_imgs = ModelInfo.objects.get(pk=model_pk).images | |
| 72 | 72 | except ModelInfo.DoesNotExist: | 
| 73 | 73 | model_imgs = [] | 
| 74 | 74 |  | 
| @@ -59,7 +59,7 @@ class BrandInfo(BaseModelMixin): | ||
| 59 | 59 | @property | 
| 60 | 60 | def data(self): | 
| 61 | 61 |          return { | 
| 62 | - 'brand_id': self.brand_id, | |
| 62 | + 'brand_id': str(self.pk), | |
| 63 | 63 | 'brand_name': self.brand_name, | 
| 64 | 64 | 'brand_descr': self.brand_descr, | 
| 65 | 65 | } | 
| @@ -85,7 +85,7 @@ class ModelInfo(BaseModelMixin): | ||
| 85 | 85 | @property | 
| 86 | 86 | def data(self): | 
| 87 | 87 |          return { | 
| 88 | - 'model_id': self.model_id, | |
| 88 | + 'model_id': str(self.pk), | |
| 89 | 89 | 'model_name': self.model_name, | 
| 90 | 90 | 'model_descr': self.model_descr, | 
| 91 | 91 | } | 
| @@ -144,7 +144,7 @@ class DistributorInfo(BaseModelMixin): | ||
| 144 | 144 | @property | 
| 145 | 145 | def data(self): | 
| 146 | 146 |          return { | 
| 147 | - 'distributor_id': self.distributor_id, | |
| 147 | + 'distributor_id': str(self.pk), | |
| 148 | 148 | 'distributor_name': self.distributor_name, | 
| 149 | 149 | 'distributor_descr': self.distributor_descr, | 
| 150 | 150 | } |