#31 API basic implementation
* adds new app to project * adds relation between User model and new APIUserToken model * adds first implementation for GET of intervention * adds basic code layout for future extension by having new versions
This commit is contained in:
@@ -15,6 +15,13 @@ from user.enums import UserNotificationEnum
|
||||
|
||||
class User(AbstractUser):
|
||||
notifications = models.ManyToManyField("user.UserNotification", related_name="+", blank=True)
|
||||
api_token = models.OneToOneField(
|
||||
"api.APIUserToken",
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text="The user's API token",
|
||||
on_delete=models.SET_NULL
|
||||
)
|
||||
|
||||
def is_notification_setting_set(self, notification_enum: UserNotificationEnum):
|
||||
return self.notifications.filter(
|
||||
|
||||
Reference in New Issue
Block a user