diff --git a/drama/classes/boards.py b/drama/classes/boards.py index 322a95c39..fe7595eff 100644 --- a/drama/classes/boards.py +++ b/drama/classes/boards.py @@ -22,7 +22,6 @@ class Board(Base, Stndrd, Age_times): is_banned=Column(Boolean, default=False) disablesignups=Column(Boolean, default=False) has_banner=Column(Boolean, default=False) - has_profile=Column(Boolean, default=False) creator_id=Column(Integer, ForeignKey("users.id")) ban_reason=Column(String(256), default=None) color=Column(String(8), default="FF66AC") diff --git a/drama/classes/user.py b/drama/classes/user.py index 4e4323abd..7bdf989ce 100644 --- a/drama/classes/user.py +++ b/drama/classes/user.py @@ -40,7 +40,6 @@ class User(Base, Stndrd, Age_times): created_utc = Column(Integer, default=0) suicide_utc = Column(Integer, default=0) admin_level = Column(Integer, default=0) - resized = Column(Boolean, default=True) agendaposter = Column(Boolean, default=False) agendaposter_expires_utc = Column(Integer, default=0) changelogsub = Column(Boolean, default=False) @@ -85,7 +84,6 @@ class User(Base, Stndrd, Age_times): login_nonce = Column(Integer, default=0) title_id = Column(Integer, ForeignKey("titles.id"), default=None) title = relationship("Title", lazy="joined") - has_profile = Column(Boolean, default=False) has_banner = Column(Boolean, default=False) reserved = Column(String(256), default=None) is_nsfw = Column(Boolean, default=False) @@ -568,7 +566,6 @@ class User(Base, Stndrd, Age_times): imageurl = upload_file(name=f"profile.gif", file=file, resize=(100, 100)) if imageurl: self.profileurl = imageurl - self.has_profile = True self.profile_upload_ip = request.remote_addr self.profile_set_utc = int(time.time()) self.profile_upload_region = request.headers.get("cf-ipcountry") @@ -590,7 +587,7 @@ class User(Base, Stndrd, Age_times): def del_profile(self): - self.has_profile = False + self.profileurl = None g.db.add(self) def del_banner(self): @@ -615,7 +612,7 @@ class User(Base, Stndrd, Age_times): @property def profile_url(self): - if self.has_profile and self.profileurl: + if self.profileurl: return self.profileurl else: return self.defaultpicture() @@ -753,7 +750,7 @@ class User(Base, Stndrd, Age_times): self.unban_utc = 0 if self.has_banner: self.del_banner() - if self.has_profile: + if self.profileurl: self.del_profile() delete_role(self, "linked") diff --git a/drama/routes/posts.py b/drama/routes/posts.py index 38f6f3681..8ba76eeae 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -22,29 +22,6 @@ from PIL import Image as PILimage with open("snappy.txt", "r") as f: snappyquotes = f.read().split("{[para]}") -@app.route("/resize") -def resize(): - u = g.db.query(User).filter(User.profileurl != None, User.resized != True).first() - if u: - print(u.username) - print(f"1 {u.profileurl}") - x = requests.get(u.profileurl) - - with open("resizing", "wb") as file: - for chunk in x.iter_content(1024): - file.write(chunk) - - image = upload_from_file("resizing", "resizing", (100, 100)) - if image == None: - send_notification(1, u, "fail!") - u.resized = True - g.db.add(u) - else: - u.profileurl = image - u.resized = True - g.db.add(u) - print(f"2 {u.profileurl}") - @app.route("/banaward/post/") @auth_required def postbanaward(post_id, v): diff --git a/drama/templates/comments.html b/drama/templates/comments.html index 62440ac6e..ab20d808d 100644 --- a/drama/templates/comments.html +++ b/drama/templates/comments.html @@ -125,7 +125,7 @@ {% if c.is_blocking %} {% endif %} {% if c.is_blocked %} {% endif %} - {% if c.author.is_deleted %}[deleted account]{% else %}{{c.author.username}}{% if c.author.customtitle %}  {{c.author.customtitle | safe}}{% endif %}{% endif %} + {% if c.author.is_deleted %}[deleted account]{% else %}{{c.author.username}}{% if c.author.customtitle %}  {{c.author.customtitle | safe}}{% endif %}{% endif %}  {{c.age_string}} {% if c.edited_utc %} diff --git a/drama/templates/settings_profile.html b/drama/templates/settings_profile.html index c6264db2d..e476119b1 100644 --- a/drama/templates/settings_profile.html +++ b/drama/templates/settings_profile.html @@ -101,7 +101,7 @@ - {% if v.has_profile %} + {% if v.profileurl %}