Skip to content

Commit

Permalink
Merge pull request momosecurity#59 from Flynnon/change_small
Browse files Browse the repository at this point in the history
修改一些格式问题 + 删除策略时提示语优化
  • Loading branch information
leohowell authored Nov 12, 2020
2 parents ac60cd6 + 028a794 commit d7b35c5
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 312 deletions.
3 changes: 1 addition & 2 deletions risk_models/cache.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# coding=utf8
import logging
import os
import random
import logging
from collections import defaultdict

import gevent

from clients.redis_client import get_config_redis_client


logger = logging.getLogger(__name__)


Expand Down
15 changes: 10 additions & 5 deletions www/core/forms.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# coding=utf8
from datetime import datetime, timedelta

from django import forms
from django.utils.translation import ugettext_lazy as _

from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Div, HTML, Reset, Field
from crispy_forms.layout import Submit, Layout, Reset, Field
from django import forms
from django.utils.translation import ugettext_lazy as _


class FormBaseMixin(object):
Expand Down Expand Up @@ -75,9 +74,15 @@ def __init__(self, *args, **kwargs):
self.fields[field].widget.attrs["class"] = "form-control"

def remove_class(self, *field_names):
self.change_class(*field_names, class_name=None)

def change_class(self, *field_names, class_name=None):
for field_name in field_names:
if field_name in self.fields:
self.fields[field_name].widget.attrs.pop('class')
if class_name is None:
self.fields[field_name].widget.attrs.pop('class')
else:
self.fields[field_name].widget.attrs['class'] = class_name

def is_edit(self):
return self.instance.pk is not None
Expand Down
262 changes: 0 additions & 262 deletions www/core/lru.py

This file was deleted.

Loading

0 comments on commit d7b35c5

Please sign in to comment.