Skip to content
Snippets Groups Projects
Commit eecea44c authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixed parsing and viewing of date properties in messages

parent b9b020d6
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,8 @@ VIPSCOREMANAGER_SERVER_NAME = "vipscoremanager"
# Set to none if using certificate signed by a CA
#VIPSCOREMANAGER_SSLCERT_PATH ="/path/to/myselfsignedcertificate.crt"
VIPSCOREMANAGER_SSLCERT_PATH = None
# Date format for dates from VIPSLogic
VIPSLOGIC_DATE_FORMAT = "%Y-%m-%d"
# Site owner info
SITE_OWNER_NAME = "FooBar Inc"
......
......@@ -25,7 +25,7 @@ def index(request):
messages_by_tag = {}
for message_tag_id in settings.FRONTPAGE_MESSAGE_TAG_IDS:
messages = Message.get_messages_by_tag(message_tag_id)
print "MESSAGES: %s" % messages
#print "MESSAGES: %s" % messages
messages_by_tag[message_tag_id] = messages
#for message in messages:
# print message
......
......@@ -17,6 +17,7 @@
import requests
from django.conf import settings
from datetime import datetime
class MessageTag:
def __init__(self,
......@@ -122,14 +123,15 @@ class Message:
def get_instance_from_dict(the_dict):
message_locale = Message.get_message_locale(the_dict["messageLocaleSet"], settings.VIPSLOGIC_LANGUAGE_CODE)
message_illustration = Message.get_illustration(the_dict["messageIllustrationSet"], settings.VIPSLOGIC_LANGUAGE_CODE)
print the_dict["datePub"]
return Message(
the_dict["messageId"],
the_dict["organizationId"],
message_locale.get("heading","MISSING HEADING FOR LOCALE '%s'" % settings.VIPSLOGIC_LANGUAGE_CODE),
message_locale.get("leadParagraph","MISSING LEAD PARAGRAPH FOR LOCALE '%s'" % settings.VIPSLOGIC_LANGUAGE_CODE),
message_locale.get("body","MISSING BODY TEXT FOR LOCALE '%s'" % settings.VIPSLOGIC_LANGUAGE_CODE),
the_dict["datePub"],
the_dict["dateValidTo"],
datetime.strptime(the_dict["datePub"],settings.VIPSLOGIC_DATE_FORMAT) ,
datetime.strptime(the_dict["dateValidTo"],settings.VIPSLOGIC_DATE_FORMAT),
message_illustration.get("file_name", None),
message_illustration.get("caption", None)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment