mirror of
https://github.com/Mistake35/Cedar-Django.git
synced 2026-07-18 00:21:14 +10:00
Bug fixes, Additional admin shit, removal of is_active
Django handles is_active for you, If your account is disabled, The site will act as if you are not authenticated. This means that all is_active checks are now pointless. - Fixed C-Token deduction - Removed is_active middleware - Removed check for signup_addr when signing up - Removed is_active logout message - Added lazy asf check that makes a profile for you if one is not found. - Removed community owner exception for rank_needed_to_post - Removed unused permission thing - Improved the admin interface even more.
This commit is contained in:
@@ -157,7 +157,7 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
hide_online = models.BooleanField(default=False, help_text='If this is ticked, the user has opted to hide their online status.')
|
||||
color = ColorField(default='', null=True, blank=True)
|
||||
|
||||
is_staff = models.BooleanField(default=False, help_text='Allow this user to access the admin panel you\'re using right now?')
|
||||
is_staff = models.BooleanField(default=False, help_text='Allow this user to access the admin panel you\'re using right now? Don\'t forget to specify the permissions.')
|
||||
is_active = models.BooleanField(default=True, help_text='If this is off, the user is basically banned and can\'t do shit here')
|
||||
is_superuser = models.BooleanField(default=False, help_text='Overrides django groups. This also allows you to change people\'s perms.')
|
||||
can_invite = models.BooleanField(default=True, help_text='Can this user invite new users? This does not matter unless the invite system is turned on.')
|
||||
@@ -174,11 +174,6 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
|
||||
objects = UserManager()
|
||||
|
||||
class Meta:
|
||||
permissions = [
|
||||
("Can_alter_level_and_Perms", "Allow this user to change Level, Groups and Permissions?"),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return self.username
|
||||
def get_full_name(self):
|
||||
@@ -755,19 +750,13 @@ class Community(models.Model):
|
||||
return False
|
||||
|
||||
def post_perm(self, request):
|
||||
if not request.user.is_active:
|
||||
return False
|
||||
if self.Community_block(request):
|
||||
return False
|
||||
if request.user.level >= self.rank_needed_to_post:
|
||||
return True
|
||||
elif request.user.is_staff == True:
|
||||
return True
|
||||
# If the community is made by you, you should be able to post in there regardless.
|
||||
elif request.user == self.creator:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return False
|
||||
def can_edit_community(self, request):
|
||||
# yanderedev moment
|
||||
if not request.user.is_authenticated:
|
||||
|
||||
Reference in New Issue
Block a user