Skip to content

Commit

Permalink
Merge pull request #256 from fism88/master
Browse files Browse the repository at this point in the history
Fixing some errors in updating Profile
  • Loading branch information
amshali committed May 1, 2012
2 parents 184537c + 746a665 commit 7dd5b42
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions app/controllers/Profiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;

Expand All @@ -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){
Expand All @@ -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){
Expand Down Expand Up @@ -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){
Expand All @@ -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){
Expand All @@ -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);
}
}

0 comments on commit 7dd5b42

Please sign in to comment.