1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Remove gravatar, as they are a privacy risk

See https://meta.stackexchange.com/questions/44717/is-gravatar-a-privacy-risk or the Mozilla Known Trackers List.
This commit is contained in:
Steffo 2019-02-06 17:01:40 +01:00
parent c21a66798f
commit 51177e5cc7
5 changed files with 6 additions and 15 deletions

12
db.py
View file

@ -17,7 +17,6 @@ import loldata
from dirty import Dirty, DirtyDelta from dirty import Dirty, DirtyDelta
import sql_queries import sql_queries
from flask import escape from flask import escape
import libgravatar
import configparser import configparser
import typing import typing
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
@ -119,7 +118,6 @@ class Royal(Base, Mini):
role = Column(String) role = Column(String)
fiorygi = Column(Integer, default=0) fiorygi = Column(Integer, default=0)
member_since = Column(Date) member_since = Column(Date)
email = Column(String)
_mini_full_name = "Royalnet" _mini_full_name = "Royalnet"
_mini_name = "ryg" _mini_name = "ryg"
@ -135,12 +133,6 @@ class Royal(Base, Mini):
def __repr__(self): def __repr__(self):
return f"<db.Royal {self.username}>" return f"<db.Royal {self.username}>"
def get_gravatar_url(self):
if self.email is None:
return f"https://www.gravatar.com/avatar/{libgravatar.md5_hash(self.username)}?d=identicon&f=y"
gravatar = libgravatar.Gravatar(self.email)
return gravatar.get_image(default="identicon", use_ssl=True)
@classmethod @classmethod
def mini_get_single_from_royal(cls, session: Session, royal: "Royal"): def mini_get_single_from_royal(cls, session: Session, royal: "Royal"):
return royal return royal
@ -1324,6 +1316,10 @@ class MatchPartecipation(Base):
return f"<MatchPartecipation {self.user.username} in {self.match.match_title}>" return f"<MatchPartecipation {self.user.username} in {self.match.match_title}>"
class IsaacQuest(Base, Mini):
...
# If run as script, create all the tables in the db # If run as script, create all the tables in the db
if __name__ == "__main__": if __name__ == "__main__":
print("Creating new tables...") print("Creating new tables...")

View file

@ -16,4 +16,4 @@ dice
raven[flask] raven[flask]
coloredlogs coloredlogs
sentry_sdk sentry_sdk
libgravatar steamleaderboards

View file

@ -726,10 +726,6 @@ img {
grid-column-start: 1; grid-column-start: 1;
grid-column-end: 3; grid-column-end: 3;
font-weight: bold; font-weight: bold;
.player-image {
border-radius: 16px;
}
} }
.member-status { .member-status {

View file

@ -24,7 +24,6 @@
{% endif %} {% endif %}
<span class="login-status"> <span class="login-status">
{% if g.user %} {% if g.user %}
<img src="{{ g.user.get_gravatar_url() }}" class="gravatar">
<a href="{{ url_for('page_profile', name=g.user.username) }}">{{ g.user.username }}</a> <a href="{{ url_for('page_profile', name=g.user.username) }}">{{ g.user.username }}</a>
<a class="btn" href="{{ url_for('page_logout') }}">Logout</a> <a class="btn" href="{{ url_for('page_logout') }}">Logout</a>
{% else %} {% else %}

View file

@ -1,7 +1,7 @@
<div class="game-panel"> <div class="game-panel">
<div class="game-grid ryg"> <div class="game-grid ryg">
<div class="player"> <div class="player">
<img class="player-image gravatar" src="{{ record.get_gravatar_url() }}"> <span class="player-name"><a href="https://ryg.steffo.eu/profile/{{ record.username }}">{{ record.username }}</a></span> <span class="player-name"><a href="https://ryg.steffo.eu/profile/{{ record.username }}">{{ record.username }}</a></span>
</div> </div>
<div class="member-status"> <div class="member-status">
<span class="role">{{ record.role }}</span> dal <span class="member-since">{% if record.member_since %}{{ record.member_since }}{% else %}????-??-??{% endif %}</span> <span class="role">{{ record.role }}</span> dal <span class="member-since">{% if record.member_since %}{{ record.member_since }}{% else %}????-??-??{% endif %}</span>