|
@@ -26,7 +26,7 @@ class EmployeeSerializer(serializers.ModelSerializer):
|
|
|
raise CustomError(u'已存在一个平台管理员,禁止操作!')
|
|
|
#标准版 限制检修人人数为2
|
|
|
tenant = self.context['request'].user.employee.tenant
|
|
|
- if int(self.initial_data['type']) == Employee.EMPLOYEE and Employee.checkEmployee(self.context['request'].user.employee.tenant) and tenant.edition == Tenant.EDITION_1:
|
|
|
+ if int(self.initial_data['type']) == Employee.EMPLOYEE and Employee.checkEmployee(self.context['request'].user.employee.tenant):
|
|
|
raise CustomError(u'当前版本,仅能添加2个检修人。如有需要,请升级到更高版本!')
|
|
|
# 判断用户是否已经注册登陆过
|
|
|
password = None
|
|
@@ -55,7 +55,7 @@ class EmployeeSerializer(serializers.ModelSerializer):
|
|
|
if int(self.initial_data['type']) == Employee.SUPER and Employee.checkSuper(instance.tenant, instance.id):
|
|
|
raise CustomError(u'已存在一个平台管理员,禁止操作!')
|
|
|
# 标准版 限制检修人人数为2
|
|
|
- if int(self.initial_data['type']) == Employee.EMPLOYEE and Employee.checkEmployee(instance.tenant, instance.id) and instance.tenant.edition == Tenant.EDITION_1:
|
|
|
+ if int(self.initial_data['type']) == Employee.EMPLOYEE and Employee.checkEmployee(instance.tenant, instance.id):
|
|
|
raise CustomError(u'当前版本,仅能添加2个检修人。如有需要,请升级到更高版本!')
|
|
|
|
|
|
username = self.initial_data['tel']
|