Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateSyntaxError #14

Open
skizzy opened this issue Mar 10, 2012 · 4 comments
Open

TemplateSyntaxError #14

skizzy opened this issue Mar 10, 2012 · 4 comments

Comments

@skizzy
Copy link

skizzy commented Mar 10, 2012

Hi caffeinehit,

After setting up the package, I tried to visit the user profile, and I’m getting this error:

       TemplateSyntaxError at /profiles/picomon/
            Invalid block tag: 'request.user|is_following:UserProfile', expected 'endblock' or 'endblock content'
          Request Method:   GET
         Request URL:   http://127.0.0.1:8000/profiles/picomon/
           Django Version:  1.3.1
           Exception Type:  TemplateSyntaxError
            Exception Value:    Invalid block tag: 'request.user|is_following:UserProfile', expected 'endblock' or 'endblock             content'
       Exception Location:  C:\Python27\lib\site-packages\django\template\base.py in invalid_block_tag, line 290
      Python Executable:    C:\Python27\python.exe
         Python Version:    2.7.2

In “follow/form.html”

               {% load follow_tags %}
  <form action="{% follow_url object %}" method="POST">
{% csrf_token %}
{% if request.user|is_following:UserProfile %}
    <input type="submit" value="Unfollow" />
{% else %}
    <input type="submit" value="Follow" />
{% endif %}
   </form>

In User’s profile template:

  {% load follow_tags %}
  {% follow_url object %}
  {% request.user|is_following:UserProfile %}
   {% follow_form object %}
    {% follow_form object "follow/form.html" %}

I registered this model:

                      utils.register(UserProfile)

Please help me out!

@flashingpumpkin
Copy link
Contributor

Hi Skizzy

Please have a look at #11 - I've already tried to show what you're doing wrong.

@skizzy
Copy link
Author

skizzy commented Mar 12, 2012

I don't mean to disturb you, it's not just working.

@flashingpumpkin
Copy link
Contributor

No worries. But you should read through the links that I've posted on #11 regarding different settings and methods. There are assumptions in your template that show a poor understanding of what is in the template context.

  • Don't edit follow/form.html
  • Pass the profile into the template tag:
{% load follow_tags %}
{% follow_form user.get_profile %}

flashingpumpkin added a commit that referenced this issue Mar 12, 2012
@skizzy
Copy link
Author

skizzy commented Mar 12, 2012

Thanks so much. It's now working! But I have a problem. And the problem is that both followers can't see each other status on their walls. I hope you get my point? Kindly help me out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants