Commits

Alejandro Núñez Liz committed a5e1063 Draft

[FIXED] Bug to render calendar

Comments (0)

Files changed (1)

simple_events/cms_plugins.py

     def formatday(self, day, weekday):
         if day != 0:
             cssclass = self.cssclasses[weekday]
-            d = reverse('events_day', args=(self.year, self.month, day))
             if date.today() == date(self.year, self.month, day):
                 cssclass += ' today'
                 body = '<a class="tipsy" href="#" title="%s">%d</a>' % (_('Today'), day)
                 if day in self.events:
+                    d = reverse('events_day', args=(self.year, self.month, day))
                     body = '<a class="tipsy" href="%s" title="%s">%d</a>' % (d, _("Events found"), day)
                 return self.day_cell(cssclass, body)
 
                 for event in self.events[day]:
                     title.append('<li><b>%s</b></li>' % esc(event.name))
                 title.append('</ul>')
+                d = reverse('events_day', args=(self.year, self.month, day))
                 body = '<a class="tipsy" href="%s" title="%s">%d</a>' % (d, _("Events found"), day)
                 return self.day_cell(cssclass, body)
             return self.day_cell(cssclass, day)