Skip to content

Commit

Permalink
using + for lazy translated strings doesn't work, with a unicode(!) t…
Browse files Browse the repository at this point in the history
…emplate string % works as expected

note: with str template string, it doesn't work!
  • Loading branch information
ThomasWaldmann committed Jan 16, 2015
1 parent 0d8f6cc commit f6f98e7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nsupdate/management/commands/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@
time.
""")

EMAIL_MSG_STALE = EMAIL_MSG_START + LOG_MSG_STALE + EMAIL_MSG_END
EMAIL_MSG_UNAVAILABLE = EMAIL_MSG_START + LOG_MSG_UNAVAILABLE + EMAIL_MSG_END
EMAIL_MSG_DELETE = EMAIL_MSG_START + LOG_MSG_DELETE + EMAIL_MSG_END_DELETED


def check_staleness(h):
"""
Expand Down Expand Up @@ -113,17 +109,20 @@ def check_staleness(h):
staleness = old_staleness + 1
if staleness >= S_delete:
h.delete()
EMAIL_MSG_DELETE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_DELETE, EMAIL_MSG_END_DELETED)
email_msg, log_msg = EMAIL_MSG_DELETE, LOG_MSG_DELETE
elif staleness >= S_unavailable:
h.staleness = staleness
h.available = False # TODO remove host from dns also
h.staleness_notification_timestamp = t_now
changed = True
EMAIL_MSG_UNAVAILABLE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_UNAVAILABLE, EMAIL_MSG_END)
email_msg, log_msg = EMAIL_MSG_UNAVAILABLE, LOG_MSG_UNAVAILABLE
else:
h.staleness = staleness
h.staleness_notification_timestamp = t_now
changed = True
EMAIL_MSG_STALE = u"%s%s%s" % (EMAIL_MSG_START, LOG_MSG_STALE, EMAIL_MSG_END)
email_msg, log_msg = EMAIL_MSG_STALE, LOG_MSG_STALE
if changed:
h.save()
Expand Down

0 comments on commit f6f98e7

Please sign in to comment.