David Cramer 12 лет назад
Родитель
Сommit
81b37bbd15

+ 17 - 0
conftest.py

@@ -33,6 +33,23 @@ def pytest_configure(config):
             'NAME': ':memory:',
             'NAME': ':memory:',
         })
         })
 
 
+    # http://djangosnippets.org/snippets/646/
+    class InvalidVarException(object):
+        def __mod__(self, missing):
+            try:
+                missing_str = unicode(missing)
+            except:
+                missing_str = 'Failed to create string representation'
+            raise Exception('Unknown template variable %r %s' % (missing, missing_str))
+
+        def __contains__(self, search):
+            if search == '%s':
+                return True
+            return False
+
+    settings.TEMPLATE_DEBUG = True
+    # settings.TEMPLATE_STRING_IF_INVALID = InvalidVarException()
+
     # Disable static compiling in tests
     # Disable static compiling in tests
     settings.STATIC_BUNDLES = {}
     settings.STATIC_BUNDLES = {}
 
 

+ 2 - 2
src/sentry/templates/sentry/account/appearance.html

@@ -27,7 +27,7 @@
             <div><legend>{% trans "Events" %}</legend></div>
             <div><legend>{% trans "Events" %}</legend></div>
 
 
             {% with form.stacktrace_order as field %}
             {% with form.stacktrace_order as field %}
-                {% include "sentry/partial/_form_field.html" %}
+                {{ field|as_crispy_field }}
             {% endwith %}
             {% endwith %}
         </fieldset>
         </fieldset>
 
 
@@ -36,7 +36,7 @@
             <div><legend>{% trans "Localization" %}</legend></div>
             <div><legend>{% trans "Localization" %}</legend></div>
 
 
             {% with form.language as field %}
             {% with form.language as field %}
-                {% include "sentry/partial/_form_field.html" %}
+                {{ field|as_crispy_field }}
             {% endwith %}
             {% endwith %}
         </fieldset>
         </fieldset>
 
 

+ 4 - 4
src/sentry/templates/sentry/account/settings.html

@@ -24,7 +24,7 @@
         <p>{% trans "To make changes to your account, you must first enter your current password." %}</p>
         <p>{% trans "To make changes to your account, you must first enter your current password." %}</p>
         {% with form.old_password as field %}
         {% with form.old_password as field %}
             {% if field %}
             {% if field %}
-                {% include "sentry/partial/_form_field.html" %}
+                {{ field|as_crispy_field }}
             {% endif %}
             {% endif %}
         {% endwith %}
         {% endwith %}
         <hr>
         <hr>
@@ -35,10 +35,10 @@
             </div>
             </div>
         </fieldset>
         </fieldset>
         {% with form.first_name as field %}
         {% with form.first_name as field %}
-            {% include "sentry/partial/_form_field.html" %}
+            {{ field|as_crispy_field }}
         {% endwith %}
         {% endwith %}
         {% with form.email as field %}
         {% with form.email as field %}
-            {% include "sentry/partial/_form_field.html" %}
+            {{ field|as_crispy_field }}
         {% endwith %}
         {% endwith %}
         <fieldset class="control-group">
         <fieldset class="control-group">
             <label>Avatar</label>
             <label>Avatar</label>
@@ -50,7 +50,7 @@
         <hr>
         <hr>
         <p>{% trans "You may also optionally change your password." %}</p>
         <p>{% trans "You may also optionally change your password." %}</p>
         {% with form.new_password as field %}
         {% with form.new_password as field %}
-            {% include "sentry/partial/_form_field.html" %}
+            {{ field|as_crispy_field }}
         {% endwith %}
         {% endwith %}
 
 
         <fieldset class="form-actions">
         <fieldset class="form-actions">

+ 1 - 1
src/sentry/templates/sentry/admin/status/mail.html

@@ -52,7 +52,7 @@
         {{ form|as_crispy_errors }}
         {{ form|as_crispy_errors }}
 
 
         {% for field in form %}
         {% for field in form %}
-            {% include "sentry/partial/_form_field.html" %}
+            {{ field|as_crispy_field }}
         {% endfor %}
         {% endfor %}
 
 
         <input type="submit" class="btn" value="{% blocktrans with request.user.email as email %}Send a test email to {{ email }}{% endblocktrans %}">
         <input type="submit" class="btn" value="{% blocktrans with request.user.email as email %}Send a test email to {{ email }}{% endblocktrans %}">

+ 1 - 1
src/sentry/templates/sentry/admin/users/edit.html

@@ -20,7 +20,7 @@
             {% csrf_token %}
             {% csrf_token %}
             {{ form|as_crispy_errors }}
             {{ form|as_crispy_errors }}
             {% for field in form %}
             {% for field in form %}
-                {% include "sentry/partial/_form_field.html" %}
+                {{ field|as_crispy_field }}
             {% endfor %}
             {% endfor %}
             <fieldset class="form-actions">
             <fieldset class="form-actions">
                 <button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>
                 <button type="submit" class="btn btn-primary">{% trans "Save Changes" %}</button>

+ 1 - 1
src/sentry/templates/sentry/admin/users/remove.html

@@ -18,7 +18,7 @@
             {% csrf_token %}
             {% csrf_token %}
             {{ form|as_crispy_errors }}
             {{ form|as_crispy_errors }}
             {% for field in form %}
             {% for field in form %}
-                {% include "sentry/partial/_form_field.html" %}
+                {{ field|as_crispy_field }}
             {% endfor %}
             {% endfor %}
             <fieldset class="form-actions">
             <fieldset class="form-actions">
                 <button type="submit" class="btn btn-danger">{% trans "Confirm" %}</button> <a href="{% url 'sentry-admin-edit-user' the_user.pk %}" class="btn">{% trans "Cancel" %}</a>
                 <button type="submit" class="btn btn-danger">{% trans "Confirm" %}</button> <a href="{% url 'sentry-admin-edit-user' the_user.pk %}" class="btn">{% trans "Cancel" %}</a>

+ 3 - 1
src/sentry/templates/sentry/events/replay_request.html

@@ -1,5 +1,6 @@
 {% extends "sentry/groups/details.html" %}
 {% extends "sentry/groups/details.html" %}
 
 
+{% load crispy_forms_tags %}
 {% load i18n %}
 {% load i18n %}
 
 
 {% block title %}{% trans "Replay Request" %} | {{ block.super }}{% endblock %}
 {% block title %}{% trans "Replay Request" %} | {{ block.super }}{% endblock %}
@@ -29,8 +30,9 @@
 
 
                 <form action="" method="post">
                 <form action="" method="post">
                     {% csrf_token %}
                     {% csrf_token %}
+                    {{ form|as_crispy_errors }}
                     {% for field in form %}
                     {% for field in form %}
-                        {% include "sentry/partial/_form_field.html" %}
+                        {{ field|as_crispy_field }}
                     {% endfor %}
                     {% endfor %}
                     <fieldset class="form-actions">
                     <fieldset class="form-actions">
                         <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
                         <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>

+ 0 - 1
src/sentry/templates/sentry/layout.html

@@ -28,7 +28,6 @@
             app.config.popupCss = '{% url 'sentry-media' "sentry" 'styles/popup.css' %}';
             app.config.popupCss = '{% url 'sentry-media' "sentry" 'styles/popup.css' %}';
             app.config.mediaUrl = '{% url 'sentry-media' "sentry" '' %}';
             app.config.mediaUrl = '{% url 'sentry-media' "sentry" '' %}';
             app.config.urlPrefix = {{ URL_PREFIX|to_json|safe }};
             app.config.urlPrefix = {{ URL_PREFIX|to_json|safe }};
-            app.config.hasRealtime = {{ hasRealtime|to_json|safe  }} || false;
             {% if project %}
             {% if project %}
                 app.config.projectId = {{ project.slug|to_json|safe }};
                 app.config.projectId = {{ project.slug|to_json|safe }};
                 app.config.teamId = {{ project.team.slug|to_json|safe }};
                 app.config.teamId = {{ project.team.slug|to_json|safe }};

+ 1 - 1
src/sentry/templates/sentry/login.html

@@ -26,7 +26,7 @@
                     {% csrf_token %}
                     {% csrf_token %}
 
 
                     {% for field in form %}
                     {% for field in form %}
-                        {% include "sentry/partial/_form_field.html" %}
+                        {{ field|as_crispy_field }}
                     {% endfor %}
                     {% endfor %}
 
 
                     <fieldset class="form-actions">
                     <fieldset class="form-actions">

+ 1 - 1
src/sentry/templates/sentry/partial/_form.html

@@ -6,7 +6,7 @@
     {{ form|as_crispy_errors }}
     {{ form|as_crispy_errors }}
 
 
     {% for field in form %}
     {% for field in form %}
-        {% include "sentry/partial/_form_field.html" %}
+        {{ field|as_crispy_field }}
     {% endfor %}
     {% endfor %}
 
 
     <fieldset class="form-actions">
     <fieldset class="form-actions">

Некоторые файлы не были показаны из-за большого количества измененных файлов