Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
"""
from django.contrib import admin
from crash.admin import TextInputFilter, BooleanFilter
from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm
class ScreenshotFilter(BooleanFilter):
title = 'Screenshot'
parameter_name = 'screenshot'
class BlackboxFilter(BooleanFilter):
title = 'Blackbox'
parameter_name = 'blackbox'
class SystemLogsFilter(BooleanFilter):
title = 'System Logs'
parameter_name = 'system_logs'
class AttachedFileFilter(BooleanFilter):
title = 'Attached File'
class ScreenshotFilter(BooleanFilter):
title = 'Screenshot'
parameter_name = 'screenshot'
class BlackboxFilter(BooleanFilter):
title = 'Blackbox'
parameter_name = 'blackbox'
class SystemLogsFilter(BooleanFilter):
title = 'System Logs'
parameter_name = 'system_logs'
class AttachedFileFilter(BooleanFilter):
title = 'Attached File'
parameter_name = 'attached_file'
def short_url(obj):
limit = 60
res = obj.page_url
return res if len(res) < limit else res[:limit] + '...'
short_url.short_description = 'Page URL'
@admin.register(Feedback)
class FeedbackAdmin(admin.ModelAdmin):
list_display = ('id', 'description', 'email', short_url, 'created_at', 'ip',)
list_display_links = ('id', 'description')
list_filter = (('id', TextInputFilter,), ScreenshotFilter, BlackboxFilter, SystemLogsFilter, AttachedFileFilter, 'created_at',)
form = FeedbackForm
from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm
class ScreenshotFilter(BooleanFilter):
title = 'Screenshot'
parameter_name = 'screenshot'
class BlackboxFilter(BooleanFilter):
title = 'Blackbox'
parameter_name = 'blackbox'
class SystemLogsFilter(BooleanFilter):
title = 'System Logs'
parameter_name = 'system_logs'
class AttachedFileFilter(BooleanFilter):
title = 'Attached File'
parameter_name = 'attached_file'
def short_url(obj):
limit = 60
res = obj.page_url
return res if len(res) < limit else res[:limit] + '...'
short_url.short_description = 'Page URL'
@admin.register(Feedback)
"""
from django.contrib import admin
from crash.admin import TextInputFilter, BooleanFilter
from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm
class ScreenshotFilter(BooleanFilter):
title = 'Screenshot'
parameter_name = 'screenshot'
class BlackboxFilter(BooleanFilter):
title = 'Blackbox'
parameter_name = 'blackbox'
class SystemLogsFilter(BooleanFilter):
title = 'System Logs'
parameter_name = 'system_logs'
class AttachedFileFilter(BooleanFilter):
title = 'Attached File'
parameter_name = 'attached_file'
def short_url(obj):
limit = 60