On Thursday 22 December 2016 17:45:56 skerdi wrote: > That get_photo func, I'm not using it. It tried to do something and I > forgot to delete it.
Try this on the Profile model: *def get_photo_url(*self, user, when_following*=True**): if *when_following*: try: if *self.following.get*(*user*=*user*)*.count*() > *0*: return *user.profile.photo.url *return None except *user.ObjectDoesNotExist*: return None else: return *user.profile.photo -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6301843.CNN0LnLRXR%40devstation. For more options, visit https://groups.google.com/d/optout.