Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change default strategy template when add strategy #1589

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dongtai_web/views/strategys.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# software: PyCharm
# project: lingzhi-webapi
from dongtai_common.models.strategy_user import IastStrategyUser
from dongtai_common.utils import const
from dongtai_common.models.hook_type import HookType
from dongtai_common.models.strategy import IastStrategyModel
Expand Down Expand Up @@ -197,6 +198,10 @@ def post(self, request):
user=request.user,
dt=time.time())
strategy.save()
content = IastStrategyUser.objects.get(pk=5).content.split(",")
if str(strategy.id) not in content:
content.append(str(strategy.id))
IastStrategyUser.objects.filter(pk=5).update(content=",".join(content))
for language in IastProgramLanguage.objects.all():
HookType.objects.create(type=3,
name=ser.validated_data['vul_name'],
Expand Down
Loading