summaryrefslogtreecommitdiffstats
path: root/module/web/pyload/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/pyload/models.py')
-rw-r--r--module/web/pyload/models.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py
index 293c01109..d3d99febc 100644
--- a/module/web/pyload/models.py
+++ b/module/web/pyload/models.py
@@ -1,21 +1,15 @@
# -*- coding: utf-8 -*-
from django.db import models
-#from django.contrib.auth.models.User import User as UserProfile
+from django.contrib.auth.models import User
# Create your models here.
-
-class Perm(models.Model):
- """ extended pyLoad user Profile """
-
- #user = models.ForeignKey(UserProfile, unique=True)
- #template = models.CharField(maxlength=30)
+class UserProfile(models.Model):
+ """ Permissions setting """
- class Meta:
- permissions = (
- ("can_see_dl", "Can see Downloads"),
- ("can_add", "Can add Downloads"),
- ("can_delete", "Can delete Downloads"),
- ("can_download", "Can download Files"),
- ("can_see_logs", "Can see logs"),
- ("can_change_status", "Can change status"),
- ) \ No newline at end of file
+ user = models.ForeignKey(User, unique=True)
+ template = models.CharField(max_length=30, default='default', null=False, blank=False)
+
+def user_post_save(sender, instance, **kwargs):
+ profile, new = UserProfile.objects.get_or_create(user=instance)
+
+models.signals.post_save.connect(user_post_save, User) \ No newline at end of file