Пример #1
0
    def save_models(self):
        #获取保持对象
        obj = self.new_obj
        obj.save()
        if obj is not None:
            real_auth = obj
            real_auth.auditor = self.user.username
            real_auth.audiTime = timezone.now()

            user_profile = UserProfile.objects.filter(
                username=real_auth.applier).first()
            #审核成功给用户添加审核成功状态位
            if real_auth.state == BitStatesUtils.STATE_AUDIT():
                # user_profile = UserProfile.objects.filter(username=real_auth.applier).first()
                user_profile.real_auth_id = real_auth.id
                # 添加审核通过状态位
                user_profile.bitState = BitStatesUtils.addState(
                    user_profile.bitState, BitStatesUtils.GET_OP_REAL_AUTH())
                user_profile.save()

            else:
                # user_profile = UserProfile.objects.filter(username=real_auth.applier).first()
                #用户的实名认证取消
                user_profile.real_auth_id = None
                #状态位更改
                if BitStatesUtils.hasState(user_profile.bitState,
                                           BitStatesUtils.GET_OP_REAL_AUTH()):
                    user_profile.bitState = BitStatesUtils.removeState(
                        user_profile.bitState,
                        BitStatesUtils.GET_OP_REAL_AUTH())

                user_profile.save()

            # real_auth.course_nums = Course.objects.filter(course_org=course_org).count()
            real_auth.save()
Пример #2
0
def is_real_audit_normal(user_profile):
    if not (user_profile.bitState is None):
        if BitStatesUtils.hasState(user_profile.bitState,
                                   BitStatesUtils.GET_OP_REAL_AUTH()):
            return True
    return False
Пример #3
0
 def isMoneyWithoutProcess(self):
     return BitStatesUtils.hasState(
         self.bitState, BitStatesUtils.GET_HAS_MONEYWITHDRAW_PROCESS())
Пример #4
0
 def isBindBankInfo(self):
     return BitStatesUtils.hasState(self.bitState,
                                    BitStatesUtils.GET_OP_BIND_BANKINFO())
Пример #5
0
 def isHasBidRequestProcess(self):
     return BitStatesUtils.hasState(
         self.bitState, BitStatesUtils.GET_OP_HAS_BIDREQUEST_PROCESS())
Пример #6
0
 def isVedioAuth(self):
     return BitStatesUtils.hasState(self.bitState,
                                    BitStatesUtils.GET_OP_VEDIO_AUTH())
Пример #7
0
 def isCheckInBasicInfo(self):
     return BitStatesUtils.hasState(self.bitState,
                                    BitStatesUtils.GET_OP_BASIC_INFO())
Пример #8
0
 def isRealAuth(self):
     return BitStatesUtils.hasState(self.bitState,
                                    BitStatesUtils.GET_OP_REAL_AUTH())