* feat: enhance authentication logging with detailed error and info messages - Added logging for various authentication events in the Adapter and its subclasses, including email validation, user existence checks, and password strength validation. - Implemented error handling for GitHub OAuth email retrieval, ensuring proper logging of unexpected responses and missing primary emails. - Updated logging configuration in local and production settings to include a dedicated logger for authentication events. * chore: address copilot comments * chore: addressed some additional comments * chore: update log * fix: lint
53 lines
1.8 KiB
Python
53 lines
1.8 KiB
Python
# Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
# See the LICENSE file for details.
|
|
|
|
# Django imports
|
|
from django.core.validators import MinValueValidator
|
|
from django.db import models
|
|
from django.db.models import Q
|
|
|
|
# Module imports
|
|
from .project import ProjectBaseModel
|
|
|
|
|
|
class Estimate(ProjectBaseModel):
|
|
name = models.CharField(max_length=255)
|
|
description = models.TextField(verbose_name="Estimate Description", blank=True)
|
|
type = models.CharField(max_length=255, default="categories")
|
|
last_used = models.BooleanField(default=False)
|
|
|
|
def __str__(self):
|
|
"""Return name of the estimate"""
|
|
return f"{self.name} <{self.project.name}>"
|
|
|
|
class Meta:
|
|
unique_together = ["name", "project", "deleted_at"]
|
|
constraints = [
|
|
models.UniqueConstraint(
|
|
fields=["name", "project"],
|
|
condition=Q(deleted_at__isnull=True),
|
|
name="estimate_unique_name_project_when_deleted_at_null",
|
|
)
|
|
]
|
|
verbose_name = "Estimate"
|
|
verbose_name_plural = "Estimates"
|
|
db_table = "estimates"
|
|
ordering = ("name",)
|
|
|
|
|
|
class EstimatePoint(ProjectBaseModel):
|
|
estimate = models.ForeignKey("db.Estimate", on_delete=models.CASCADE, related_name="points")
|
|
key = models.IntegerField(default=0, validators=[MinValueValidator(0)])
|
|
description = models.TextField(blank=True)
|
|
value = models.CharField(max_length=255)
|
|
|
|
def __str__(self):
|
|
"""Return name of the estimate"""
|
|
return f"{self.estimate.name} <{self.key}> <{self.value}>"
|
|
|
|
class Meta:
|
|
verbose_name = "Estimate Point"
|
|
verbose_name_plural = "Estimate Points"
|
|
db_table = "estimate_points"
|
|
ordering = ("value",)
|