mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 15:56:34 +01:00
Add better plugin description + new example plugin
Add better plugin description + new example plugin
This commit is contained in:
15
testPlugin/signals.py
Normal file
15
testPlugin/signals.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
from django.contrib.auth.models import User
|
||||
from .models import TestPluginSettings
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
def create_user_settings(sender, instance, created, **kwargs):
|
||||
"""Create default plugin settings when a new user is created"""
|
||||
if created:
|
||||
TestPluginSettings.objects.create(
|
||||
user=instance,
|
||||
plugin_enabled=True
|
||||
)
|
||||
Reference in New Issue
Block a user