feat: added external api endpoints for creating users and adding attachments to issues (#5193)
* feat: added external id and external source for issue attachments * feat: added endpoint for creating users * feat: added issue attachment endpoint * fix: converted user to workspace member * chore: removed code blocking adding issues when the cycle has been completed * chore: update models * chore: added user recent visited table --------- Co-authored-by: pablohashescobar <nikhilschacko@gmail.com> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
parent
66c2cbe7d6
commit
3a6d3d4e82
12 changed files with 444 additions and 20 deletions
38
apiserver/plane/db/models/recent_visit.py
Normal file
38
apiserver/plane/db/models/recent_visit.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Django imports
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
|
||||
# Module imports
|
||||
from .workspace import WorkspaceBaseModel
|
||||
|
||||
|
||||
class EntityNameEnum(models.TextChoices):
|
||||
VIEW = "VIEW", "View"
|
||||
PAGE = "PAGE", "Page"
|
||||
ISSUE = "ISSUE", "Issue"
|
||||
CYCLE = "CYCLE", "Cycle"
|
||||
MODULE = "MODULE", "Module"
|
||||
PROJECT = "PROJECT", "Project"
|
||||
|
||||
|
||||
class UserRecentVisit(WorkspaceBaseModel):
|
||||
entity_identifier = models.UUIDField(null=True)
|
||||
entity_name = models.CharField(
|
||||
max_length=30,
|
||||
choices=EntityNameEnum.choices,
|
||||
)
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="user_recent_visit",
|
||||
)
|
||||
visited_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "User Recent Visit"
|
||||
verbose_name_plural = "User Recent Visits"
|
||||
db_table = "user_recent_visits"
|
||||
ordering = ("-created_at",)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.entity_name} {self.user.email}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue