def name_error():
quotafile = open(fspath+"/global/sys/quotainfo", 'r')
quotas = json.loads(quotafile.read())
quotafile.close()
if quotas['default'] == 'fundation':
quotas['default'] = 'foundation'
quotafile = open(fspath+"/global/sys/quotainfo",'w')
quotafile.write(json.dumps(quotas))
quotafile.close()
groupfile = open(fspath+"/global/sys/quota", 'r')
groups = json.loads(groupfile.read())
groupfile.close()
for group in groups:
if group['name'] == 'fundation':
group['name'] = 'foundation'
groupfile = open(fspath+"/global/sys/quota",'w')
groupfile.write(json.dumps(groups))
groupfile.close()
users = User.query.filter_by(user_group = 'fundation').all()
for user in users:
user.user_group = 'foundation'
db.session.commit()
评论列表
文章目录