build: merge frontend and backend into a single repo
This commit is contained in:
parent
10ce333e6f
commit
26ec1e8c15
126 changed files with 8280 additions and 1 deletions
34
apiserver/plane/db/models/social_connection.py
Normal file
34
apiserver/plane/db/models/social_connection.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Django imports
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
|
||||
# Module import
|
||||
from . import BaseModel
|
||||
|
||||
|
||||
class SocialLoginConnection(BaseModel):
|
||||
medium = models.CharField(
|
||||
max_length=20,
|
||||
choices=(("Google", "google"), ("Github", "github")),
|
||||
default=None,
|
||||
)
|
||||
last_login_at = models.DateTimeField(default=timezone.now, null=True)
|
||||
last_received_at = models.DateTimeField(default=timezone.now, null=True)
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="user_login_connections",
|
||||
)
|
||||
token_data = models.JSONField(null=True)
|
||||
extra_data = models.JSONField(null=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Social Login Connection"
|
||||
verbose_name_plural = "Social Login Connections"
|
||||
db_table = "social_login_connection"
|
||||
ordering = ("-created_at",)
|
||||
|
||||
def __str__(self):
|
||||
"""Return name of the user and medium"""
|
||||
return f"{self.medium} <{self.user.email}>"
|
||||
Loading…
Add table
Add a link
Reference in a new issue