mirror of
https://github.com/Mistake35/Cedar-Django.git
synced 2026-07-17 16:11:14 +10:00
pain
- Added list_filter in admin.py for more models. - IP bans now work when not signed in - Invites are void if you are banned or disabled. - Removed Discord video support (it was a pointless feature) - Various HTML changes - Made the theme much darker. - Changed the color of the logo and favicon. Too lazy to change the rest of the assets for now.
This commit is contained in:
+33
-13
@@ -48,10 +48,11 @@ def Enable_user(modeladmin, request, queryset):
|
||||
|
||||
class UserAdmin(BaseUserAdmin):
|
||||
search_fields = ('id', 'username', 'nickname', )
|
||||
list_display = ('id', 'username', 'nickname', 'level', 'is_active', 'is_staff', 'is_superuser')
|
||||
list_display = ('id', 'created', 'username', 'nickname', 'level', 'is_active', 'is_staff', 'is_superuser')
|
||||
actions = [Disable_user, Enable_user]
|
||||
raw_id_fields = ('role', )
|
||||
readonly_fields = ('last_login', 'created', )
|
||||
list_filter = ('is_active', 'is_staff', 'can_invite', 'role', 'created', )
|
||||
fieldsets = (
|
||||
(None, {'fields': ('nickname', 'username', 'password')}),
|
||||
('Personal info', {'fields': ('email', ('addr', 'signup_addr'))}),
|
||||
@@ -103,27 +104,31 @@ class ProfileAdmin(admin.ModelAdmin):
|
||||
search_fields = ('id', 'user__username__icontains', 'comment', 'origin_id',)
|
||||
raw_id_fields = ('user', 'favorite',)
|
||||
list_display = ('id', 'user', 'comment', 'let_freedom',)
|
||||
list_filter = ('let_freedom', 'is_new', )
|
||||
|
||||
class InvitesAdmin(admin.ModelAdmin):
|
||||
search_fields = ('creator__username', 'used_by__username', 'code', )
|
||||
raw_id_fields = ('creator', 'used_by', )
|
||||
list_display = ('creator', 'used_by', 'code', 'used', 'void', )
|
||||
list_display = ('created', 'creator', 'used_by', 'code', 'used', 'void', )
|
||||
list_filter = ('used', 'void', 'created', )
|
||||
actions = [Void_invite, Restore_invite]
|
||||
|
||||
class ComplaintAdmin(admin.ModelAdmin):
|
||||
search_fields = ('body', 'creator__username', )
|
||||
raw_id_fields = ('creator', )
|
||||
list_display = ('creator', 'type', 'body', )
|
||||
list_display = ('created', 'creator', 'type', 'body', )
|
||||
list_filter = ('type', 'created', )
|
||||
|
||||
class ConversationAdmin(admin.ModelAdmin):
|
||||
search_fields = ('id', 'source__username', 'target__username')
|
||||
raw_id_fields = ('source', 'target', )
|
||||
list_display = ('source', 'target', )
|
||||
list_display = ('created', 'source', 'target', )
|
||||
|
||||
class PostAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('creator', 'poll', )
|
||||
search_fields = ('id', 'body', 'creator__username', )
|
||||
list_display = ('id', 'creator', 'body', 'is_rm', )
|
||||
list_display = ('id', 'created', 'creator', 'body', 'is_rm', )
|
||||
list_filter = ('is_rm', 'created', )
|
||||
actions = [Hide_content, Show_content, Disable_comments, Enable_comments]
|
||||
def get_queryset(self, request):
|
||||
return models.Post.real.get_queryset()
|
||||
@@ -131,24 +136,26 @@ class PostAdmin(admin.ModelAdmin):
|
||||
class CommentAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('creator', 'original_post', )
|
||||
search_fields = ('id', 'body', 'creator__username', )
|
||||
list_display = ('id', 'creator', 'body', 'original_post', 'is_rm', )
|
||||
list_display = ('id', 'created', 'creator', 'body', 'original_post', 'is_rm', )
|
||||
list_filter = ('is_rm', 'created', )
|
||||
actions = [Hide_content, Show_content]
|
||||
def get_queryset(self, request):
|
||||
return models.Comment.real.get_queryset()
|
||||
|
||||
class CommunityAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('creator', )
|
||||
list_display = ('id', 'name', 'description', 'type', 'creator', 'popularity', 'is_rm', 'is_feature', 'require_auth')
|
||||
list_display = ('id', 'created', 'name', 'description', 'type', 'creator', 'popularity', 'is_rm', 'is_feature', 'require_auth')
|
||||
search_fields = ('id', 'name', 'description', 'creator__username')
|
||||
actions = [Hide_content, Show_content, Feature_community, Unfeature_community, force_login, unforce_login]
|
||||
list_filter = ('type', 'is_rm', 'is_feature', 'require_auth')
|
||||
list_filter = ('type', 'is_rm', 'is_feature', 'require_auth', 'created', )
|
||||
def get_queryset(self, request):
|
||||
return models.Community.real.get_queryset()
|
||||
|
||||
class MessageAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('creator', 'conversation', )
|
||||
search_fields = ('id', 'body', 'creator__username', )
|
||||
list_display = ('created', 'creator', 'conversation', 'body', 'is_rm', )
|
||||
list_display = ('id', 'created', 'creator', 'conversation', 'body', 'read', 'is_rm', )
|
||||
list_filter = ('is_rm', 'read', 'created', )
|
||||
actions = [Hide_content, Show_content]
|
||||
def get_queryset(self, request):
|
||||
return models.Message.real.get_queryset()
|
||||
@@ -167,7 +174,8 @@ class NotificationAdmin(admin.ModelAdmin):
|
||||
combined_display.short_description = 'Content'
|
||||
raw_id_fields = ('to', 'source', 'context_post', 'context_comment',)
|
||||
search_fields = ('to__username', 'source__username', 'context_post__body', 'context_comment__body',)
|
||||
list_display = ('id', 'to', 'source', 'combined_display',)
|
||||
list_display = ('id', 'created', 'to', 'source', 'combined_display',)
|
||||
list_filter = ('read', 'created', )
|
||||
|
||||
class AuditAdmin(admin.ModelAdmin):
|
||||
def combined_display(self, obj):
|
||||
@@ -184,10 +192,12 @@ class AuditAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('by', 'user', 'post', 'comment', 'community', 'reversed_by', )
|
||||
list_display = ('by', 'user', 'type', 'combined_display', )
|
||||
search_fields = ('by__username', 'user__username', 'post__body', 'comment__body', 'community__name', )
|
||||
list_filter = ('type', 'created', )
|
||||
|
||||
class AdsAdmin(admin.ModelAdmin):
|
||||
list_display = ('url', 'imageurl', )
|
||||
list_display = ('id', 'created', 'url', 'imageurl', )
|
||||
search_fields = ('url', 'imageurl', )
|
||||
list_filter = ('created', )
|
||||
|
||||
class YeahAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('by', 'post', 'comment', )
|
||||
@@ -204,6 +214,7 @@ class RoleAdmin(admin.ModelAdmin):
|
||||
class BanAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('to', 'by')
|
||||
list_display = ('by', 'to', 'reason', 'expiry_date', 'active')
|
||||
list_filter = ('expiry_date', 'active', 'created', )
|
||||
|
||||
def save_model(self, request, obj, form, change):
|
||||
# Set the 'by' field to the currently logged-in user
|
||||
@@ -224,13 +235,22 @@ class BanAdmin(admin.ModelAdmin):
|
||||
|
||||
class LoginAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('user',)
|
||||
list_display = ('user', 'addr', 'user_agent', )
|
||||
list_display = ('id', 'created', 'user', 'addr', 'user_agent', )
|
||||
search_fields = ('user__username', 'addr', 'user_agent', )
|
||||
list_filter = ('created', )
|
||||
|
||||
|
||||
class WarningAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('by', 'to')
|
||||
list_display = ('by', 'to', 'reason', )
|
||||
search_fields = ('by__username', 'to__username', 'reason', )
|
||||
list_filter = ('created', )
|
||||
|
||||
class BlockAdmin(admin.ModelAdmin):
|
||||
raw_id_fields = ('source', 'target')
|
||||
list_display = ('id', 'created', 'source', 'target', )
|
||||
search_fields = ('created__username', 'source__username', )
|
||||
list_filter = ('created', )
|
||||
|
||||
admin.site.register(models.Role, RoleAdmin)
|
||||
admin.site.register(models.User, UserAdmin)
|
||||
@@ -242,7 +262,7 @@ admin.site.register(models.Message, MessageAdmin)
|
||||
admin.site.register(models.Conversation, ConversationAdmin)
|
||||
admin.site.register(models.Notification, NotificationAdmin)
|
||||
admin.site.register(models.LoginAttempt, LoginAdmin)
|
||||
admin.site.register(models.UserBlock)
|
||||
admin.site.register(models.UserBlock, BlockAdmin)
|
||||
admin.site.register(models.AuditLog, AuditAdmin)
|
||||
admin.site.register(models.ProfileHistory, HistoryAdmin)
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class PurgeForm(forms.Form):
|
||||
restore_all = forms.BooleanField(required=False, label='Restore purged content', help_text='Restore everything that was purged, this will not apply to posts deleted manually.')
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
username = forms.CharField(max_length=255, widget=forms.TextInput(attrs={'class': 'auth-input', 'placeholder': 'Username'}))
|
||||
username = forms.CharField(max_length=255, widget=forms.TextInput(attrs={'class': 'auth-input', 'placeholder': 'Username / Email'}))
|
||||
password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'auth-input', 'placeholder': 'Password'}))
|
||||
|
||||
def clean(self):
|
||||
@@ -127,6 +127,10 @@ class LoginForm(forms.Form):
|
||||
raise forms.ValidationError("This account's password needs to be reset. Contact an admin or reset by email.", code='required_reset')
|
||||
elif not user[0].is_active:
|
||||
raise forms.ValidationError("This account was disabled.", code='disabled')
|
||||
# Check for active user ban
|
||||
active_user_ban = Ban.objects.filter(to=user[0], active=True, expiry_date__gte=timezone.now()).first()
|
||||
if active_user_ban:
|
||||
raise forms.ValidationError("This account has been banned until {}. Reason: {}".format(active_user_ban.expiry_date, active_user_ban.reason), code='banned')
|
||||
return cleaned_data
|
||||
|
||||
class User_tools_Form(forms.ModelForm):
|
||||
|
||||
@@ -46,6 +46,15 @@ class CheckForBanMiddleware:
|
||||
return response
|
||||
|
||||
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||
# Get one active ban that is not expired for the IP address
|
||||
ip_address = request.META.get('REMOTE_ADDR')
|
||||
active_ip_ban = Ban.objects.filter(
|
||||
ip_address=ip_address,
|
||||
active=True,
|
||||
expiry_date__gte=timezone.now(),).first()
|
||||
if active_ip_ban:
|
||||
context = {'ban': active_ip_ban}
|
||||
return render(request, 'ban.html', context)
|
||||
if not request.user.is_authenticated:
|
||||
return None
|
||||
# Get one active ban that is not expired for the user
|
||||
@@ -56,15 +65,6 @@ class CheckForBanMiddleware:
|
||||
if active_user_ban:
|
||||
context = {'ban': active_user_ban}
|
||||
return render(request, 'ban.html', context)
|
||||
# Get one active ban that is not expired for the IP address
|
||||
ip_address = request.META.get('REMOTE_ADDR')
|
||||
active_ip_ban = Ban.objects.filter(
|
||||
ip_address=ip_address,
|
||||
active=True,
|
||||
expiry_date__gte=timezone.now(),).first()
|
||||
if active_ip_ban:
|
||||
context = {'ban': active_ip_ban}
|
||||
return render(request, 'ban.html', context)
|
||||
return None
|
||||
|
||||
class ClosedMiddleware(object):
|
||||
|
||||
+13
-20
@@ -130,7 +130,7 @@ class Role(models.Model):
|
||||
organization = models.CharField(max_length=255, blank=True, null=True, help_text='Text that shows above one\'s username')
|
||||
|
||||
def __str__(self):
|
||||
return "role \"" + str(self.organization) + "\", name " + str(self.image)
|
||||
return str(self.organization)
|
||||
|
||||
#mii_domain = 'https://mii-secure.cdn.nintendo.net'
|
||||
# as of writing, mii-secure is unstable, nintendo please do not f*ck me for this
|
||||
@@ -414,18 +414,17 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
|
||||
# Admin can-manage
|
||||
def can_manage(self):
|
||||
if self.level >= settings.level_needed_to_man_users or self.is_staff:
|
||||
if self.level >= settings.level_needed_to_man_users:
|
||||
can_manage = True
|
||||
else:
|
||||
can_manage = False
|
||||
return can_manage
|
||||
# Does self have authority over user?
|
||||
def has_authority(self, user):
|
||||
if user.is_authenticated:
|
||||
if self.is_staff and not user.is_staff:
|
||||
return True
|
||||
if self.level >= user.level:
|
||||
return True
|
||||
if not user.is_authenticated:
|
||||
return False
|
||||
if self.level >= user.level:
|
||||
return True
|
||||
return False
|
||||
def friend_state(self, other):
|
||||
# Todo: return -1 for cannot, 0 for nothing, 1 for my friend pending, 2 for their friend pending, 3 for friends
|
||||
@@ -642,7 +641,9 @@ class Invites(models.Model):
|
||||
def is_valid(self):
|
||||
if self.used or self.void:
|
||||
return False
|
||||
if not self.creator.can_invite:
|
||||
if not self.creator.can_invite or not self.creator.is_active:
|
||||
return False
|
||||
if self.creator.active_ban():
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -693,13 +694,14 @@ class Community(models.Model):
|
||||
5: 'PC Game',
|
||||
6: 'Xbox Game',
|
||||
7: 'Playstation Game',
|
||||
8: 'Cross-platform Game',
|
||||
}.get(self.platform)
|
||||
else:
|
||||
return {
|
||||
0: "General community",
|
||||
1: "Game community",
|
||||
2: "Special community",
|
||||
3: "User owned community",
|
||||
3: "User-created community",
|
||||
}.get(self.type)
|
||||
def type_platform(self):
|
||||
thing = {
|
||||
@@ -711,7 +713,7 @@ class Community(models.Model):
|
||||
5: 'pc',
|
||||
6: 'xbox',
|
||||
7: 'ps',
|
||||
8: 'youre-mom',
|
||||
8: 'cross-platform',
|
||||
}.get(self.platform)
|
||||
if not thing:
|
||||
return None
|
||||
@@ -838,7 +840,7 @@ class Community(models.Model):
|
||||
# Check for spam using our OWN ALGO!!!!!!!!!
|
||||
if request.user.has_postspam(body, upload, drawing):
|
||||
return 7
|
||||
for keyword in ['faggot', 'fag', 'nigger', 'nigga', 'hitler']:
|
||||
for keyword in ['faggot', 'fag', 'nigger', 'nigga']:
|
||||
if keyword in body.lower():
|
||||
return 9
|
||||
if body.isspace() and not drawing:
|
||||
@@ -906,15 +908,6 @@ class Post(models.Model):
|
||||
except:
|
||||
return False
|
||||
return thing
|
||||
def discord_vid(self):
|
||||
try:
|
||||
thing = re.search('(https?://)?(www\.)?(cdn)?(discordapp)\.(com)/attachments/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/(.+)', self.url).group(8)
|
||||
if thing.endswith(".mp4") or thing.endswith(".webm"):
|
||||
return thing
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
def has_line_trun(self):
|
||||
if self.body and len(self.body.splitlines()) > 10:
|
||||
return True
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<label class="file-button-container">
|
||||
<span class="input-label">Image <span id="image-dimensions">PNG and JPEG are allowed.</span></span>
|
||||
<span class="button file-upload-button">Upload</span>
|
||||
<input accept="image/gif, image/png, image/jpeg, image/jpg, image/svg+xml, image/bmp" type="file" style="display: none;" id="upload-file" name="screen">
|
||||
<input accept="image/gif, image/png, image/jpeg, image/jpg, image/svg+xml, image/webp, image/bmp" type="file" style="display: none;" id="upload-file" name="screen">
|
||||
<div id="upload-preview-container" class="screenshot-container still-image" style="display: none;">
|
||||
<img id="upload-preview">
|
||||
<!-- not functional currently
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
{% if user.has_freedom %}
|
||||
<input type="text" class="textarea-line url-form" name="url" placeholder="URL/YT/Discord video" maxlength="1024">
|
||||
<input type="text" class="textarea-line url-form" name="url" placeholder="URL / YouTube Video" maxlength="1024">
|
||||
{% file_button %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -20,16 +20,14 @@
|
||||
<span class="spoiler">(handwritten)</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if post.yt_vid %}
|
||||
<a href="{% url "main:post-view" post.id %}" class="screenshot-container video"><img height="48" src="https://i.ytimg.com/vi/{{ post.yt_vid }}/default.jpg"></a>
|
||||
{% elif post.discord_vid %}
|
||||
<div class="screenshot-container video"><video src="{{ post.url }}" width="50" height="48"></video></div>
|
||||
{% if post.yt_vid %}
|
||||
<a href="{% url "main:post-view" post.id %}" class="{% if not for_announcements %}screenshot-container {% else %}announcement-container {% endif %}video"><img height="48" src="https://i.ytimg.com/vi/{{ post.yt_vid }}/default.jpg"></a>
|
||||
{% endif %}
|
||||
{% if post.screenshot %}
|
||||
<a href="{% url "main:post-view" post.id %}" class="{% if not for_announcements %}screenshot-container {% endif %}still-image"><img src="{{ post.screenshot }}"></a>
|
||||
<a href="{% url "main:post-view" post.id %}" class="{% if not for_announcements %}screenshot-container {% else %}announcement-container {% endif %}still-image"><img src="{{ post.screenshot }}"></a>
|
||||
{% endif %}
|
||||
{% if post.video %}
|
||||
<div class="screenshot-container video"><video src="{{ post.video }}" width="50" height="48"></video></div>
|
||||
<div class="{% if not for_announcements %}screenshot-container {% else %}announcement-container {% endif %} video"><video src="{{ post.video }}" width="50" height="48"></video></div>
|
||||
{% endif %}
|
||||
{% if post.drawing %}
|
||||
<p class="post-content-memo"><img src="{{ post.drawing }}" class="post-memo"></p>
|
||||
|
||||
@@ -4,17 +4,27 @@
|
||||
{% if user.banned %}
|
||||
<div class="notice" style="background-color: #ff9797;border: 1px solid #ff5252;">
|
||||
<b>Notice</b>: This user is banned.
|
||||
<div>
|
||||
{% if user.active_ban.reason %}
|
||||
<p>Reason: "{{ user.active_ban.reason }}"</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not user.is_active %}
|
||||
<div class="notice" style="background-color: #ff9797;border: 1px solid #ff5252;">
|
||||
<b>Notice</b>: This account has been disabled indefinitely.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if profile.limit_post and user.limit_remaining <= 0 and not user.active_ban %}
|
||||
<div class="notice">
|
||||
<b>Notice</b>: This user is out of posts for today.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="sidebar-container">
|
||||
{% if profile.favorite.screenshot %}
|
||||
<a href="{% url "main:post-view" profile.favorite_id %}" id="sidebar-cover" style="background-image:url({{ profile.favorite.screenshot }})">
|
||||
<a href="{% url "main:post-view" profile.favorite_id %}" id="sidebar-cover">
|
||||
<img src="{{ profile.favorite.screenshot }}" class="sidebar-cover-image">
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -158,6 +168,14 @@
|
||||
<span>#{{ user.id }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% if profile.limit_post and request.user.can_manage %}
|
||||
<div class="data-content">
|
||||
<h4><span>Post Limit</span></h4>
|
||||
<div class="note">
|
||||
<span>{{ profile.limit_post }} ({{ user.limit_remaining }} left)</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="data-content">
|
||||
<h4><span>Date Joined</span></h4>
|
||||
<div class="note">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
<button type="submit" class="black-button">Sign In</button>
|
||||
<button type="submit" class="button">Sign In</button>
|
||||
<div class="ll">
|
||||
{% if allow_signups %}
|
||||
<p>If you don't have an account, <a href="{% url "main:signup" %}"><b>sign up</b> here.</a></p>
|
||||
|
||||
@@ -31,9 +31,6 @@
|
||||
<div class="user-name-content">
|
||||
{% if post.creator.get_class.1 %}<p class="user-organization">{% user_level post.creator %}</p>{% endif %}
|
||||
{% p_username post.creator %}
|
||||
{% if not post.creator.is_active %}
|
||||
<p style="color: #f00;">Banned</p>
|
||||
{% endif %}
|
||||
<p class="timestamp-container">
|
||||
<span class="timestamp">{% time post.created %}</span>
|
||||
{% if post.drawing %}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<p class="lh">Sign Up</p>
|
||||
<p>Create a {{ brand_name }} account to make posts and comments to various communities, give Yeahs to other users' content, and interact with other members of the {{ brand_name }} community.</p><br>
|
||||
<p>Please follow <a href="{% url "main:help-rules" %}">our rules</a>. If you don't, be careful with your behavior.<br><br>You <strong>must</strong> be {{ age }} years of age or older to join, no exceptions.<br>If you are suspected to be younger than {{ age }} years old, we will ban you until you're {{ age }}.</p>
|
||||
{% if invite_only %}<h3 class="label"><label><span class="red">*</span> Invite code: <input type="text" class="auth-input" name="invite_code" maxlength="64" minlength="4" placeholder="Invite code"></label></h3>{% endif %}
|
||||
{% if invite_only %}<h3 class="label"><label><span class="red">*</span> Invite key: <input type="text" class="auth-input" name="invite_code" maxlength="64" minlength="4" placeholder="Invite key"></label></h3>{% endif %}
|
||||
<h3 class="label"><label><span class="red">*$</span> Username: <input type="text" class="auth-input" name="username" maxlength="32" minlength="4" placeholder="Username"></label></h3>
|
||||
<h3 class="label"><label><span class="red">*</span>Nickname: <input type="text" class="auth-input" name="nickname" maxlength="32" placeholder="Nick/Mii name?"></label></h3>
|
||||
<h3 class="label nnid"><label>Nintendo Network ID: <input type="text" class="auth-input" name="origin_id" maxlength="16" minlength="6" placeholder="NNID" data-mii-domain="{{ mii_domain }}" data-action="{{ mii_endpoint }}">
|
||||
@@ -26,6 +26,7 @@
|
||||
<button type="submit" class="button" onclick="event.preventDefault();cac();">Create account</button>
|
||||
<div class="ll">
|
||||
<p>All fields with a red asterisk (<span class="red">*</span>) are required.</p>
|
||||
{% if invite_only %}<p>You need an invite key to sign up to {{ brand_name }}. If you don't have one, you're out of luck.</p>{% endif %}
|
||||
<p>NNIDs are only required for getting a Mii from.</p>
|
||||
<p>You will be able to change your avatar (or use a custom one) after you sign up.</p>
|
||||
<p><span class="red">%</span>: If you don't fill in your email address, you can't reset your password until you have one.</p>
|
||||
|
||||
@@ -73,7 +73,7 @@ def community_list(request):
|
||||
else:
|
||||
ad = "no ads"
|
||||
# announcements within the past week-ish
|
||||
announcements = Post.objects.filter(community__tags='announcements', created__gte=Now()-timedelta(days=5)).order_by('-created')[:6]
|
||||
announcements = Post.objects.filter(community__tags='announcements', spoils=False, created__gte=Now()-timedelta(days=5)).order_by('-created')[:6]
|
||||
if request.user.is_authenticated:
|
||||
my_communities = obj.filter(creator=request.user).order_by('-created')[0:12]
|
||||
else:
|
||||
@@ -295,8 +295,8 @@ def signup_page(request):
|
||||
check_others = Profile.objects.filter(user__addr=request.META['REMOTE_ADDR'], let_freedom=False).exists()
|
||||
if check_others:
|
||||
return HttpResponseBadRequest("Unfortunately, you cannot make any accounts at this time. This restriction was set for a reason, please contact the administration. Please don't bypass this, as if you do, you are just being ignorant. If you have not made any accounts, contact the administration and this restriction will be removed for you.")
|
||||
check_othersban = User.objects.filter(addr=request.META['REMOTE_ADDR'], is_active=False).exists()
|
||||
if check_othersban:
|
||||
check_bans = User.objects.filter(addr=request.META['REMOTE_ADDR'], is_active=False).exists()
|
||||
if check_bans:
|
||||
return HttpResponseBadRequest("You cannot sign up while banned.")
|
||||
if iphub(request.META['REMOTE_ADDR']):
|
||||
if settings.DISALLOW_PROXY:
|
||||
|
||||
Reference in New Issue
Block a user