From 746a665411f2358e2dd9bcf353fd5ff2c38890d1 Mon Sep 17 00:00:00 2001 From: Faraaz Ismail Date: Tue, 1 May 2012 14:01:11 -0500 Subject: [PATCH] Correcting errors from moving views/Application/edit_basic.html to views/User/profile.html --- app/controllers/Profiles.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/controllers/Profiles.java b/app/controllers/Profiles.java index a8c4bac..ed017ed 100644 --- a/app/controllers/Profiles.java +++ b/app/controllers/Profiles.java @@ -32,7 +32,7 @@ public static void updateBio(String bio){ profile.bio = ""; profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } public static void updateInformation(String birthday, String relationshipStatus, String gender, String interestedIn, @@ -50,10 +50,12 @@ public static void updateInformation(String birthday, String relationshipStatus, profile.gender = gender; profile.interestedIn = interestedIn; DateFormat anniversary_formatting = new SimpleDateFormat("MM/dd/yyyy"); - try { - profile.anniversary = (Date) anniversary_formatting.parse(anniversary); - } catch (java.text.ParseException e) { - e.printStackTrace(); + if(anniversary != null){ + try { + profile.anniversary = (Date) anniversary_formatting.parse(anniversary); + } catch (java.text.ParseException e) { + e.printStackTrace(); + } } // profile.relationshipStatus = relationshipStatus; @@ -66,7 +68,7 @@ public static void updateInformation(String birthday, String relationshipStatus, profile.political = political; profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } public static void updateContactInfo(String phone, String address){ @@ -92,7 +94,7 @@ public static void updateContactInfo(String phone, String address){ profile.address = ""; profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } public static void updateWorkEdu(String edu, String work){ @@ -124,7 +126,7 @@ public static void updateWorkEdu(String edu, String work){ profile.work.add(employment); */ profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } public static void updateLiving(String hometown){ @@ -143,7 +145,7 @@ public static void updateLiving(String hometown){ profile.hometown = null; profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } public static void updateQuote(String quotation){ @@ -156,6 +158,6 @@ public static void updateQuote(String quotation){ profile.quotes = ""; profile.save(); - renderTemplate("Application/edit_basic.html", profile); + renderTemplate("Users/profile.html", profile); } } \ No newline at end of file