Fixe l'inscription, affiche un avatar par défaut

This commit is contained in:
2017-03-29 10:38:37 +02:00
parent 0a73c16191
commit cbc9a8ac7d
12 changed files with 2074 additions and 54 deletions

View File

@ -19,9 +19,9 @@ namespace Yavsc.Helpers
{
var user = dbContext.Users.FirstOrDefault(u => u.Id == userId);
if (user==null) return Constants.AnonAvatar;
if (user.Avatar==null) return Constants.DefaultAvatar;
if (user.Avatar.StartsWith("/"))
{
// use fmt
FileInfo fi = new FileInfo(user.Avatar);
var ext = fi.Extension;
var avatar = user.Avatar.Substring(0, user.Avatar.Length - ext.Length );