Commit 13246eaeff4ce919035529c0c66fff0d96240d9c
1 parent
593fca42
Exists in
master
and in
39 other branches
Corrigindo problema na view do perfil do usuario nao cadastrado
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
colab/super_archives/templatetags/form_field.py
... | ... | @@ -38,7 +38,7 @@ class RenderFormField(template.Node): |
38 | 38 | try: |
39 | 39 | default_value = self.default_value_nocontext.resolve(context) |
40 | 40 | except template.VariableDoesNotExist: |
41 | - pass | |
41 | + default_value = '' | |
42 | 42 | |
43 | 43 | if editable: |
44 | 44 | form_field_tag = '<br/>' + str(form_field) | ... | ... |
colab/views.py
... | ... | @@ -104,8 +104,13 @@ def user_profile(request, user, email_address=None, editable=False, form=None): |
104 | 104 | emails = Message.objects.raw(query) |
105 | 105 | n_sent = Message.objects.filter(from_address__in=email_addresses).count() |
106 | 106 | |
107 | + if user: | |
108 | + profile = user.profile | |
109 | + else: | |
110 | + profile = None | |
111 | + | |
107 | 112 | template_data = { |
108 | - 'user_profile': user.profile or None, | |
113 | + 'user_profile': profile, | |
109 | 114 | 'email_address': email_address, |
110 | 115 | 'emails': emails or [], |
111 | 116 | 'form': form, | ... | ... |