From 002c7e764c5c10ccdfe1eec3eebac023d02c2fb2 Mon Sep 17 00:00:00 2001 From: Ashutosh singh <55102089+Ashutosh619-sudo@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:20:58 +0530 Subject: [PATCH] Feat: add craeted_by, updated_by to mapping_settings (#130) * Feat: Add Mixin to add created_by and updated_by for configuration models * change name * fix pylint * fix linting * correct linting * fixing lint * pylint resolving * still resolving lint * again resolving pylint * ye again resolving pylint * final resolving * ignoring save method override warning * remove unused imports * Feat: Resolve Import Error * bump version * resolve lint * Feat: add craeted_by, updated_by to mapping_settings * version up --- .../migrations/0028_auto_20241226_1030.py | 23 +++++++++++++++++++ fyle_accounting_mappings/models.py | 3 ++- setup.py | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 fyle_accounting_mappings/migrations/0028_auto_20241226_1030.py diff --git a/fyle_accounting_mappings/migrations/0028_auto_20241226_1030.py b/fyle_accounting_mappings/migrations/0028_auto_20241226_1030.py new file mode 100644 index 0000000..e5349d4 --- /dev/null +++ b/fyle_accounting_mappings/migrations/0028_auto_20241226_1030.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.14 on 2024-12-26 10:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('fyle_accounting_mappings', '0027_alter_employeemapping_source_employee'), + ] + + operations = [ + migrations.AddField( + model_name='mappingsetting', + name='created_by', + field=models.CharField(blank=True, help_text='Email of the user who created this record', max_length=255, null=True), + ), + migrations.AddField( + model_name='mappingsetting', + name='updated_by', + field=models.CharField(blank=True, help_text='Email of the user who last updated this record', max_length=255, null=True), + ), + ] diff --git a/fyle_accounting_mappings/models.py b/fyle_accounting_mappings/models.py index da5c23a..6e4a28f 100644 --- a/fyle_accounting_mappings/models.py +++ b/fyle_accounting_mappings/models.py @@ -9,6 +9,7 @@ from .exceptions import BulkError from .utils import assert_valid +from .mixins import AutoAddCreateUpdateInfoMixin workspace_models = importlib.import_module("apps.workspaces.models") Workspace = workspace_models.Workspace @@ -518,7 +519,7 @@ def create_or_update_expense_fields(attributes: List[Dict], fields_included: Lis return expense_fields -class MappingSetting(models.Model): +class MappingSetting(AutoAddCreateUpdateInfoMixin, models.Model): """ Mapping Settings """ diff --git a/setup.py b/setup.py index eb94159..601a42a 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='fyle-accounting-mappings', - version='1.36.1', + version='1.36.2', author='Shwetabh Kumar', author_email='shwetabh.kumar@fyle.in', description='Django application to store the fyle accounting mappings in a generic manner',