diff --git a/boards/models/post/__init__.py b/boards/models/post/__init__.py --- a/boards/models/post/__init__.py +++ b/boards/models/post/__init__.py @@ -1,6 +1,7 @@ import uuid +import hashlib +import re -import re from boards import settings from boards.abstracts.tripcode import Tripcode from boards.models import Attachment, KeyPair, GlobalId @@ -400,3 +401,6 @@ class Post(models.Model, Viewable): def get_tags(self): return self.get_thread().get_tags() + + def get_ip_color(self): + return hashlib.md5(self.poster_ip.encode()).hexdigest()[:6] diff --git a/boards/templates/boards/post.html b/boards/templates/boards/post.html --- a/boards/templates/boards/post.html +++ b/boards/templates/boards/post.html @@ -7,7 +7,11 @@
#{{ post.id }} {{ post.title }} - + {% if post.tripcode %} / {% with tripcode=post.get_tripcode %}