Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move now() to be called in function not at import

  • Loading branch information...
commit 2fb7807b44ee412a1ded4f63897176e580685ddc 1 parent 1d248a8
@meldra authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 brain/views.py
View
5 brain/views.py
@@ -28,7 +28,6 @@
from gzip import GzipFile
from libravatar import libravatar_url
-now = datetime.now()
withyear = False
def parse_mbox(message):
@@ -153,6 +152,8 @@ def formatweek(self, theweek, month, year):
return '<tr>%s</tr>' % s
def formatday(self, day, weekday, month, year):
+ now = datetime.now()
+
if day == now.day and month == now.month and year == now.year:
today = 'today '
else:
@@ -192,6 +193,8 @@ def singleday(year, month, day):
return '\n'.join(v)
def index(request, year=0, month=0, day=0):
+ now = datetime.now()
+
cal = WhereisCalendar(calendar.SUNDAY)
day = int(day)
month = int(month)
Please sign in to comment.
Something went wrong with that request. Please try again.