From e36c765f1a455dab0a31ff47b8d81f7655af40d9 Mon Sep 17 00:00:00 2001 From: AntonioRodriguezRuiz Date: Fri, 14 Jul 2023 12:10:51 +0200 Subject: [PATCH 1/3] fix: seed_log not saved on update --- experiments/models.py | 2 +- experiments/serializers.py | 2 +- experiments/views.py | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/experiments/models.py b/experiments/models.py index 84bc915..515bd02 100644 --- a/experiments/models.py +++ b/experiments/models.py @@ -25,7 +25,7 @@ class Experiment(models.Model): number_scenarios = models.IntegerField(null=True, blank=True) variability_conf = models.JSONField(null=True, blank=True) scenarios_conf = models.JSONField(null=True, blank=True) - seed = models.CharField(null=True, blank=True, max_length=2500) + seed_log = models.CharField(null=True, blank=True, max_length=2500) special_colnames = models.JSONField(null=True, blank=True) screenshots = PrivateFileField("Screenshots", null=True) screenshots_path = models.CharField(null=True, blank=True, max_length=255) diff --git a/experiments/serializers.py b/experiments/serializers.py index 18c43ef..a3776bf 100644 --- a/experiments/serializers.py +++ b/experiments/serializers.py @@ -9,7 +9,7 @@ class ExperimentSerializer(serializers.ModelSerializer): class Meta: model = Experiment depth = 1 - fields = ['id', 'created_at', 'last_edition', 'execution_start', 'execution_finish', 'size_balance', 'seed','name', 'description', 'number_scenarios', + fields = ['id', 'created_at', 'last_edition', 'execution_start', 'execution_finish', 'size_balance', 'seed_log','name', 'description', 'number_scenarios', 'variability_conf', 'scenarios_conf', 'special_colnames', 'is_being_processed', 'is_active', 'status', 'screenshots_path', 'foldername', 'screenshot_name_generation_function', 'public', 'user'] diff --git a/experiments/views.py b/experiments/views.py index d18f5b6..c56f0c5 100644 --- a/experiments/views.py +++ b/experiments/views.py @@ -104,8 +104,8 @@ def post(self, request, *args, **kwargs): description=request.data.get('description'), number_scenarios=int(request.data.get('number_scenarios')) if request.data.get( 'number_scenarios') else None, - seed=request.data.get('seedLog') if request.data.get( - 'seedLog') else None, + seed_log=request.data.get('seed_log') if request.data.get( + 'seed_log') else None, variability_conf=json_attributes_load(request.data.get( 'variability_conf')) if request.data.get('variability_conf') else None, scenarios_conf=json_attributes_load(request.data.get( @@ -199,7 +199,7 @@ def put(self, request, id, *args, **kwars): if request.data.get('number_scenarios') and int(request.data.get('number_scenarios')) > 0 and not ('scenarios_conf' in request.data): return Response({"message": "POST experiment executing - Incomplete data: Number scenarios greater than 1 and no scenario configuration included!"}, status=status.HTTP_400_BAD_REQUEST) for data in ['size_balance', 'name', 'number_scenarios', - 'variability_conf', + 'variability_conf', 'seed_log', 'special_colnames', 'screenshot_name_generation_function']: if not data in request.data: return Response({"message": "POST experiment executing - Incomplete data: " + data + " not included"}, status=status.HTTP_400_BAD_REQUEST) @@ -221,6 +221,7 @@ def put(self, request, id, *args, **kwars): request.data.get('size_balance')) experiment.name = request.data.get('name') experiment.description = request.data.get('description') + experiment.seed_log = request.data.get('seed_log') experiment.number_scenarios = int(request.data.get( 'number_scenarios')) if request.data.get('number_scenarios') else None experiment.variability_conf = json_attributes_load(request.data.get( From 085bc080d560685fb95a905256da3b7ac8e1503b Mon Sep 17 00:00:00 2001 From: AntonioRodriguezRuiz Date: Tue, 18 Jul 2023 11:14:56 +0200 Subject: [PATCH 2/3] feat: Experiment names unique by user --- experiments/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/experiments/models.py b/experiments/models.py index 515bd02..039a9d5 100644 --- a/experiments/models.py +++ b/experiments/models.py @@ -39,6 +39,7 @@ class Experiment(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='ExperimentOwner') class Meta: + unique_together = ['name', 'user'] ordering = ["-created_at"] def __str__(self): From a00c59b7a82ed3a81976fbec57f66fecee2fd483 Mon Sep 17 00:00:00 2001 From: Antonio Date: Wed, 6 Sep 2023 10:56:05 +0200 Subject: [PATCH 3/3] [fix]: email confirmation settings --- bpmloggenerator/production.py | 2 +- bpmloggenerator/settings.py | 2 +- configuration/db_populate_v1.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bpmloggenerator/production.py b/bpmloggenerator/production.py index a547367..6f07edd 100644 --- a/bpmloggenerator/production.py +++ b/bpmloggenerator/production.py @@ -245,7 +245,7 @@ EMAIL_HOST = env('EMAIL_HOST') EMAIL_PORT = 587 # EMAIL_PORT = 465 -DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER') +DEFAULT_FROM_EMAIL = env('EMAIL_FROM') EMAIL_HOST_USER = env('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD') EMAIL_USE_TLS = True diff --git a/bpmloggenerator/settings.py b/bpmloggenerator/settings.py index 0505bf6..ab33c68 100644 --- a/bpmloggenerator/settings.py +++ b/bpmloggenerator/settings.py @@ -246,7 +246,7 @@ EMAIL_HOST = env('EMAIL_HOST') EMAIL_PORT = 587 # EMAIL_PORT = 465 -DEFAULT_FROM_EMAIL = env('EMAIL_HOST_USER') +DEFAULT_FROM_EMAIL = env('EMAIL_FROM') EMAIL_HOST_USER = env('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD') EMAIL_USE_TLS = True diff --git a/configuration/db_populate_v1.json b/configuration/db_populate_v1.json index a244232..8d4b7b6 100644 --- a/configuration/db_populate_v1.json +++ b/configuration/db_populate_v1.json @@ -1047,7 +1047,7 @@ "username": "admin", "first_name": "", "last_name": "", - "email": "info@processautomation.es", + "email": "amrojas@us.es", "is_staff": true, "is_active": true, "date_joined": "2022-03-10T10:18:41.361Z",