Added Pre-Commit Hooks (#175)
* Added pre commit hook * Run pre commit hook on all files --------- Co-authored-by: Horilla <131998600+horilla-opensource@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
117e8e88c2
commit
58be33a8d7
@@ -3,7 +3,8 @@ admin.py
|
||||
"""
|
||||
|
||||
from django.contrib import admin
|
||||
from horilla_audit.models import HorillaAuditLog, HorillaAuditInfo, AuditTag
|
||||
|
||||
from horilla_audit.models import AuditTag, HorillaAuditInfo, HorillaAuditLog
|
||||
|
||||
# Register your models here.
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ context_processor.py
|
||||
This module is used to register context processor`
|
||||
"""
|
||||
|
||||
from django.urls import path, include
|
||||
from django.http import JsonResponse
|
||||
from django.urls import include, path
|
||||
|
||||
from horilla.urls import urlpatterns
|
||||
from horilla_audit.forms import HistoryForm
|
||||
from horilla_audit.models import AuditTag
|
||||
from horilla.urls import urlpatterns
|
||||
|
||||
|
||||
def history_form(request):
|
||||
|
||||
@@ -4,11 +4,13 @@ forms.py
|
||||
|
||||
from collections.abc import Mapping
|
||||
from typing import Any
|
||||
|
||||
from django import forms
|
||||
from django.forms.utils import ErrorList
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.template.loader import render_to_string
|
||||
from horilla_audit.models import HorillaAuditInfo, AuditTag
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from horilla_audit.models import AuditTag, HorillaAuditInfo
|
||||
|
||||
|
||||
class HistoryForm(forms.Form):
|
||||
|
||||
@@ -4,8 +4,8 @@ methods.py
|
||||
This module is used to write methods related to the history
|
||||
"""
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Bot:
|
||||
@@ -139,6 +139,7 @@ def get_diff(instance):
|
||||
)
|
||||
if instance._meta.model_name == "employeeworkinformation":
|
||||
from .models import HistoryTrackingFields
|
||||
|
||||
history_tracking_instance = HistoryTrackingFields.objects.first()
|
||||
if history_tracking_instance:
|
||||
track_fields = history_tracking_instance.tracking_fields["tracking_fields"]
|
||||
|
||||
@@ -3,6 +3,7 @@ models.py
|
||||
"""
|
||||
|
||||
from collections.abc import Iterable
|
||||
|
||||
from django.db import models
|
||||
from django.dispatch import receiver
|
||||
from simple_history.models import (
|
||||
@@ -11,18 +12,15 @@ from simple_history.models import (
|
||||
_history_user_getter,
|
||||
_history_user_setter,
|
||||
)
|
||||
from simple_history.signals import (
|
||||
from simple_history.signals import ( # pre_create_historical_m2m_records,; post_create_historical_m2m_records,
|
||||
post_create_historical_record,
|
||||
pre_create_historical_record,
|
||||
# pre_create_historical_m2m_records,
|
||||
# post_create_historical_m2m_records,
|
||||
)
|
||||
|
||||
# from employee.models import Employee
|
||||
from horilla.models import HorillaModel
|
||||
from horilla_audit.methods import remove_duplicate_history
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from django.template.defaultfilters import register
|
||||
from django import template
|
||||
from employee.models import Employee, EmployeeWorkInformation
|
||||
from django.core.paginator import Page, Paginator
|
||||
from django.template.defaultfilters import register
|
||||
|
||||
from employee.models import Employee, EmployeeWorkInformation
|
||||
|
||||
|
||||
@register.filter(name="fk_history")
|
||||
|
||||
Reference in New Issue
Block a user