Merge branch 'master' into mistletoe
commit
658e309bfb
|
@ -15,7 +15,7 @@ from .clients import *
|
|||
from files.__main__ import Base, cache
|
||||
from files.helpers.security import *
|
||||
import random
|
||||
from os import environ
|
||||
from os import environ, remove
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
@ -472,6 +472,10 @@ class User(Base):
|
|||
ban_time = int(time.time()) + (days * 86400)
|
||||
self.unban_utc = ban_time
|
||||
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.profileurl = None
|
||||
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():
|
||||
v.agendaposter_expires_utc = 0
|
||||
v.agendaposter = False
|
||||
v.agendaposter = None
|
||||
send_notification(v.id, "Your agendaposter theme has expired!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(26)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.flairchanged and v.flairchanged < time.time():
|
||||
|
|
|
@ -761,6 +761,10 @@ def settings_images_banner(v):
|
|||
@auth_required
|
||||
@validate_formkey
|
||||
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.profileurl = None
|
||||
g.db.add(v)
|
||||
|
@ -774,12 +778,13 @@ def settings_delete_profile(v):
|
|||
@validate_formkey
|
||||
def settings_delete_banner(v):
|
||||
|
||||
if v.bannerurl:
|
||||
if '/images/' in v.bannerurl: os.remove('/images/' + v.bannerurl.split('/images/')[1])
|
||||
v.bannerurl = None
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
return render_template("settings_profile.html", v=v,
|
||||
msg="Banner successfully removed.")
|
||||
return render_template("settings_profile.html", v=v, msg="Banner successfully removed.")
|
||||
|
||||
|
||||
@app.get("/settings/blocks")
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</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>
|
||||
.awards-wrapper input[type="radio"] {
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
</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>
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
{% block scripts %}
|
||||
{% 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>
|
||||
function formkey() {return '{{v.formkey}}';}
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
</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>
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
</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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
</label>
|
||||
<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>
|
||||
|
||||
|
@ -173,7 +173,7 @@
|
|||
</div>
|
||||
{% 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="/assets/js/submit.js?v=72"></script>
|
||||
|
|
Loading…
Reference in New Issue