| @@ -38,6 +38,7 @@ from utils.error.errno_utils import (AdministratorStatusCode, ComplementCodeStat | ||
| 38 | 38 |  | 
| 39 | 39 | WECHAT = settings.WECHAT | 
| 40 | 40 |  | 
| 41 | + | |
| 41 | 42 | @logit | 
| 42 | 43 | @check_admin | 
| 43 | 44 | def change_password(request, administrator): | 
| @@ -1249,7 +1250,6 @@ def member_activity_contribute_welfare_unlocking_list(request, administrator): | ||
| 1249 | 1250 | if is_handled != '': | 
| 1250 | 1251 | unlockings = unlockings.filter(is_handled=is_handled) | 
| 1251 | 1252 |  | 
| 1252 | - | |
| 1253 | 1253 |      unlockings = unlockings.order_by('-pk') | 
| 1254 | 1254 | count = unlockings.count() | 
| 1255 | 1255 | unlockings, left = pagination(unlockings, page, num) | 
| @@ -12,16 +12,18 @@ from django_response import response | ||
| 12 | 12 | from paginator import pagination | 
| 13 | 13 | from TimeConvert import TimeConvert as tc | 
| 14 | 14 |  | 
| 15 | +from account.models import UserInfo | |
| 15 | 16 | from api.tenancy_views import tenancy_tracking_info_subscribe | 
| 16 | 17 | from kodo.decorators import check_admin | 
| 17 | 18 | from pre.custom_message import sendtemplatemessage | 
| 18 | -from account.models import UserInfo | |
| 19 | 19 | from tenancy.models import TenancyShotInfo, TenancyShotRequestInfo | 
| 20 | 20 | from utils.error.errno_utils import TenancyStatusCode | 
| 21 | 21 | from utils.kuaidi.synquery import KuaiDi100 | 
| 22 | 22 |  | 
| 23 | + | |
| 23 | 24 | WECHAT = settings.WECHAT | 
| 24 | 25 |  | 
| 26 | + | |
| 25 | 27 | @logit | 
| 26 | 28 | @check_admin | 
| 27 | 29 | def shot_list(request, administrator): | 
| @@ -34,7 +36,7 @@ def shot_list(request, administrator): | ||
| 34 | 36 |      shots = TenancyShotInfo.objects.filter(status=True).order_by('-pk') | 
| 35 | 37 | if tenancy_status != '': | 
| 36 | 38 | shots = shots.filter(tenancy_status=tenancy_status) | 
| 37 | - | |
| 39 | + | |
| 38 | 40 | if model_id: | 
| 39 | 41 | shots = shots.filter(model_id=model_id) | 
| 40 | 42 |  | 
| @@ -132,7 +134,6 @@ def shot_request_list(request, administrator): | ||
| 132 | 134 |          shots = list(TenancyShotInfo.objects.values_list('shot_id', flat=True).filter(sn__icontains=query)) | 
| 133 | 135 | reqs = reqs.filter(Q(phone__icontains=query) | Q(name__icontains=query) | Q(shot_id__in=shots)) | 
| 134 | 136 |  | 
| 135 | - | |
| 136 | 137 | if request_status != 'all': | 
| 137 | 138 | reqs = reqs.filter(request_status=request_status) | 
| 138 | 139 |  | 
| @@ -280,12 +281,12 @@ def shot_request_send(request, administrator): | ||
| 280 | 281 | req = TenancyShotRequestInfo.objects.select_for_update().get(request_id=req_id, status=True) | 
| 281 | 282 | except TenancyShotRequestInfo.DoesNotExist: | 
| 282 | 283 | return response(TenancyStatusCode.TENANCY_SHOT_REQUEST_NOT_FOUND) | 
| 283 | - | |
| 284 | + | |
| 284 | 285 | try: | 
| 285 | 286 | shot = TenancyShotInfo.objects.get(shot_id=shot_id, status=True) | 
| 286 | 287 | except TenancyShotInfo.DoesNotExist: | 
| 287 | 288 | return response() | 
| 288 | - | |
| 289 | + | |
| 289 | 290 | if req.admin_id and req.admin_id != administrator.admin_id: | 
| 290 | 291 | return response(40001, 'No permission', '不是经办人,没有权限') | 
| 291 | 292 |  | 
| @@ -335,7 +336,7 @@ def shot_request_send(request, administrator): | ||
| 335 | 336 | "value": shot.data['model_info']['model_name'], | 
| 336 | 337 | "color": "#173177" | 
| 337 | 338 | }, | 
| 338 | -             "character_string4": { | |
| 339 | +            "character_string4": { | |
| 339 | 340 | "value": shot.sn, | 
| 340 | 341 | "color": "#173177" | 
| 341 | 342 | }, | 
| @@ -13,8 +13,8 @@ from json_response import JsonResponse | ||
| 13 | 13 | from paginator import pagination | 
| 14 | 14 | from TimeConvert import TimeConvert as tc | 
| 15 | 15 |  | 
| 16 | -from tenancy.models import TenancyShotInfo, TenancyShotRequestInfo | |
| 17 | 16 | from mch.models import ModelInfo | 
| 17 | +from tenancy.models import TenancyShotInfo, TenancyShotRequestInfo | |
| 18 | 18 | from utils.error.errno_utils import TenancyStatusCode | 
| 19 | 19 | from utils.kuaidi.subscribe import KuaiDi100 as KuaiDi100Subscribe | 
| 20 | 20 |  | 
| @@ -8,10 +8,10 @@ from django_admin import AdvancedActionsModelAdmin, AdvancedExportExcelModelAdmi | ||
| 8 | 8 | from django_models_ext import ProvinceShortModelMixin | 
| 9 | 9 | from pysnippets.strsnippets import strip | 
| 10 | 10 |  | 
| 11 | +from integral.models import SaleclerkSubmitLogInfo | |
| 11 | 12 | from mch.models import (ActivityInfo, AdministratorInfo, BrandInfo, CameraModelInfo, ConsumeInfoSubmitLogInfo, | 
| 12 | 13 | DistributorInfo, LatestAppInfo, LatestAppScreenInfo, MaintenancemanInfo, ModelCameraBodyInfo, | 
| 13 | 14 | ModelInfo, OperatorInfo, SaleclerkInfo) | 
| 14 | -from integral.models import SaleclerkSubmitLogInfo | |
| 15 | 15 | from utils.redis.rshot import update_member_shot_data | 
| 16 | 16 |  | 
| 17 | 17 |  | 
| @@ -77,7 +77,7 @@ class ModelInfoAdmin(AdvancedExportExcelModelAdmin, DeleteModelAdmin, admin.Mode | ||
| 77 | 77 | obj.brand_name = BrandInfo.objects.get(brand_id=obj.brand_id).brand_name | 
| 78 | 78 | except BrandInfo.DoesNotExist: | 
| 79 | 79 | obj.brand_name = '' | 
| 80 | - | |
| 80 | + | |
| 81 | 81 | obj.is_show_shot = True | 
| 82 | 82 | obj.save() | 
| 83 | 83 |  | 
| @@ -85,7 +85,7 @@ class ModelInfoAdmin(AdvancedExportExcelModelAdmin, DeleteModelAdmin, admin.Mode | ||
| 85 | 85 |  | 
| 86 | 86 | update_member_shot_data() | 
| 87 | 87 |  | 
| 88 | - #更新用户提交列表和销售员提交列表 | |
| 88 | + # 更新用户提交列表和销售员提交列表 | |
| 89 | 89 | SaleclerkSubmitLogInfo.objects.filter(model_pk=obj.pk).update( | 
| 90 | 90 | model_name=obj.model_name, | 
| 91 | 91 | model_uni_name=obj.model_uni_name, | 
| @@ -153,7 +153,7 @@ class ModelInfo(BaseModelMixin): | ||
| 153 | 153 |          ('CANON', u'佳能'), | 
| 154 | 154 |          ('NIKON', u'尼康'), | 
| 155 | 155 | ) | 
| 156 | - | |
| 156 | + | |
| 157 | 157 | brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) | 
| 158 | 158 | brand_name = models.CharField(_(u'brand_name'), max_length=255, blank=True, null=True, help_text=u'品牌名称') | 
| 159 | 159 |  | 
| @@ -451,7 +451,7 @@ class MemberActivityInfo(BaseModelMixin, BrandInfoMixin): | ||
| 451 | 451 | def is_signed(self, user_id): | 
| 452 | 452 | # 是否已报名 | 
| 453 | 453 | return MemberActivitySignupInfo.objects.filter(user_id=user_id, activity_id=self.activity_id, status=True).exists() | 
| 454 | - | |
| 454 | + | |
| 455 | 455 | def is_selected(self, user_id): | 
| 456 | 456 | # 是否已报名 | 
| 457 | 457 | return MemberActivityContributionInfo.objects.filter(user_id=user_id, activity_id=self.activity_id, status=True, is_selected=True, audit_status=1, content_type=0).exists() | 
| @@ -925,7 +925,7 @@ class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMi | ||
| 925 | 925 | welfare = MemberActivityContributionWelfareInfo.objects.get(welfare_id=self.welfare_id) | 
| 926 | 926 | except MemberActivityContributionWelfareInfo.DoesNotExist: | 
| 927 | 927 | welfare = None | 
| 928 | - | |
| 928 | + | |
| 929 | 929 | try: | 
| 930 | 930 | user = MemberActivitySignupInfo.objects.get(user_id=self.user_id, activity_id=self.activity_id) | 
| 931 | 931 | except MemberActivitySignupInfo.DoesNotExist: | 
| @@ -7,7 +7,7 @@ from jsonfield import JSONField | ||
| 7 | 7 | from shortuuidfield import ShortUUIDField | 
| 8 | 8 | from TimeConvert import TimeConvert as tc | 
| 9 | 9 |  | 
| 10 | -from mch.models import ModelInfo, AdministratorInfo | |
| 10 | +from mch.models import AdministratorInfo, ModelInfo | |
| 11 | 11 |  | 
| 12 | 12 |  | 
| 13 | 13 | class TenancyShotInfo(BaseModelMixin): | 
| @@ -78,7 +78,7 @@ class TenancyShotRequestInfo(BaseModelMixin): | ||
| 78 | 78 |  | 
| 79 | 79 | user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True) | 
| 80 | 80 |  | 
| 81 | - #镜头配件信息 | |
| 81 | + # 镜头配件信息 | |
| 82 | 82 | front_cap_status = models.BooleanField(_(u'front_cap_status'), default=False, help_text=u'前盖状态') | 
| 83 | 83 | rear_cap_status = models.BooleanField(_(u'rear_cap_status'), default=False, help_text=u'后盖状态') | 
| 84 | 84 | lens_hood_status = models.BooleanField(_(u'lens_hood_status'), default=False, help_text=u'遮光罩状态') | 
| @@ -125,7 +125,7 @@ class TenancyShotRequestInfo(BaseModelMixin): | ||
| 125 | 125 | request_status = models.CharField(_(u'request_status'), max_length=16, default='', help_text=u'租借申请状态') | 
| 126 | 126 |      request_status_at = JSONField(_(u'request_status_at'), blank=True, null=True, default={}, help_text=u'租借申请状态变更时间') | 
| 127 | 127 |  | 
| 128 | - remark = models.CharField(_(u'remark'), max_length=256, default='', help_text=u'备注') | |
| 128 | + remark = models.CharField(_(u'remark'), max_length=256, default='', help_text=u'备注') | |
| 129 | 129 |  | 
| 130 | 130 | class Meta: | 
| 131 | 131 | verbose_name = _(u'租赁镜头申请信息') | 
| @@ -140,7 +140,7 @@ class TenancyShotRequestInfo(BaseModelMixin): | ||
| 140 | 140 | shot = TenancyShotInfo.objects.get(shot_id=self.shot_id) | 
| 141 | 141 | except TenancyShotInfo.DoesNotExist: | 
| 142 | 142 | shot = None | 
| 143 | - | |
| 143 | + | |
| 144 | 144 | try: | 
| 145 | 145 | model = ModelInfo.objects.get(model_id=self.model_id, status=True) | 
| 146 | 146 | except ModelInfo.DoesNotExist: | 
| @@ -198,7 +198,7 @@ class TenancyShotRequestInfo(BaseModelMixin): | ||
| 198 | 198 | shot = TenancyShotInfo.objects.get(shot_id=self.shot_id, status=True) | 
| 199 | 199 | except TenancyShotInfo.DoesNotExist: | 
| 200 | 200 | shot = None | 
| 201 | - | |
| 201 | + | |
| 202 | 202 | try: | 
| 203 | 203 | model = ModelInfo.objects.get(model_id=self.model_id, status=True) | 
| 204 | 204 | except ModelInfo.DoesNotExist: |