Merge branch 'master' into mistletoe
commit
658e309bfb
|
@ -15,7 +15,7 @@ from .clients import *
|
||||||
from files.__main__ import Base, cache
|
from files.__main__ import Base, cache
|
||||||
from files.helpers.security import *
|
from files.helpers.security import *
|
||||||
import random
|
import random
|
||||||
from os import environ
|
from os import environ, remove
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
site_name = environ.get("SITE_NAME").strip()
|
site_name = environ.get("SITE_NAME").strip()
|
||||||
|
@ -472,6 +472,10 @@ class User(Base):
|
||||||
ban_time = int(time.time()) + (days * 86400)
|
ban_time = int(time.time()) + (days * 86400)
|
||||||
self.unban_utc = ban_time
|
self.unban_utc = ban_time
|
||||||
else:
|
else:
|
||||||
|
if self.highres and '/images/' in self.highres: remove('/images/' + self.highres.split('/images/')[1])
|
||||||
|
if self.profileurl and '/images/' in self.profileurl: remove('/images/' + self.profileurl.split('/images/')[1])
|
||||||
|
if self.bannerurl and '/images/' in self.bannerurl: remove('/images/' + self.bannerurl.split('/images/')[1])
|
||||||
|
|
||||||
self.bannerurl = None
|
self.bannerurl = None
|
||||||
self.profileurl = None
|
self.profileurl = None
|
||||||
if self.discord_id: remove_user(self)
|
if self.discord_id: remove_user(self)
|
||||||
|
|
|
@ -156,9 +156,11 @@ def front_all(v):
|
||||||
|
|
||||||
if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time():
|
if v.agendaposter_expires_utc and v.agendaposter_expires_utc < time.time():
|
||||||
v.agendaposter_expires_utc = 0
|
v.agendaposter_expires_utc = 0
|
||||||
v.agendaposter = False
|
v.agendaposter = None
|
||||||
send_notification(v.id, "Your agendaposter theme has expired!")
|
send_notification(v.id, "Your agendaposter theme has expired!")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
badge = v.has_badge(26)
|
||||||
|
if badge: g.db.delete(badge)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if v.flairchanged and v.flairchanged < time.time():
|
if v.flairchanged and v.flairchanged < time.time():
|
||||||
|
|
|
@ -761,6 +761,10 @@ def settings_images_banner(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def settings_delete_profile(v):
|
def settings_delete_profile(v):
|
||||||
|
|
||||||
|
if v.highres and '/images/' in v.highres: os.remove('/images/' + v.highres.split('/images/')[1])
|
||||||
|
if v.profileurl and '/images/' in v.profileurl: os.remove('/images/' + v.profileurl.split('/images/')[1])
|
||||||
|
|
||||||
v.highres = None
|
v.highres = None
|
||||||
v.profileurl = None
|
v.profileurl = None
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
@ -774,12 +778,13 @@ def settings_delete_profile(v):
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def settings_delete_banner(v):
|
def settings_delete_banner(v):
|
||||||
|
|
||||||
v.bannerurl = None
|
if v.bannerurl:
|
||||||
g.db.add(v)
|
if '/images/' in v.bannerurl: os.remove('/images/' + v.bannerurl.split('/images/')[1])
|
||||||
g.db.commit()
|
v.bannerurl = None
|
||||||
|
g.db.add(v)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
return render_template("settings_profile.html", v=v,
|
return render_template("settings_profile.html", v=v, msg="Banner successfully removed.")
|
||||||
msg="Banner successfully removed.")
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/settings/blocks")
|
@app.get("/settings/blocks")
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script defer src="/assets/js/award_modal.js?v=57"></script>
|
<script defer src="/assets/js/award_modal.js?v=58"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.awards-wrapper input[type="radio"] {
|
.awards-wrapper input[type="radio"] {
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function formkey() {return '{{v.formkey}}';}
|
function formkey() {return '{{v.formkey}}';}
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
<script defer src="/assets/js/signup.js?v=63"></script>
|
<script defer src="/assets/js/signup.js?v=63"></script>
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
<input id="file-upload" type="file" name="file" {% if request.headers.get('cf-ipcountry')=="T1" %}disabled{% endif %} accept="image/*, video/*" hidden>
|
<input id="file-upload" type="file" name="file" {% if request.headers.get('cf-ipcountry')=="T1" %}disabled{% endif %} accept="image/*, video/*" hidden>
|
||||||
</label>
|
</label>
|
||||||
<small class="form-text text-muted">Optional if you have text.</small>
|
<small class="form-text text-muted">Optional if you have text.</small>
|
||||||
<small class="form-text text-muted">You can upload videos up to 1 minute long.</small>
|
<small class="form-text text-muted">You can upload images or videos up to 1 minute long.</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script defer src="https://cdn.jsdelivr.net/npm/marked@3.0.8/lib/marked.min.js"></script>
|
<script defer src="https://cdn.jsdelivr.net/npm/marked@3.0.8/lib/marked.min.js"></script>
|
||||||
|
|
||||||
<script defer src="/assets/js/submit.js?v=72"></script>
|
<script defer src="/assets/js/submit.js?v=72"></script>
|
||||||
|
|
Loading…
Reference in New Issue