Skip to content
Snippets Groups Projects
Commit 65edeb1a authored by Alexander Pace's avatar Alexander Pace
Browse files

gracedb-2.30.0

parent 83d5c314
No related branches found
No related tags found
1 merge request!249gracedb-2.30.0
Pipeline #687883 passed
......@@ -48,7 +48,7 @@ INFO_BANNER_MESSAGE = "TEST MESSAGE"
BETA_REPORTS_LINK = False
# Version ---------------------------------------------------------------------
PROJECT_VERSION = '2.29.0'
PROJECT_VERSION = '2.30.0'
# Unauthenticated access ------------------------------------------------------
# This variable should eventually control whether unauthenticated access is
......@@ -463,7 +463,7 @@ REST_FRAMEWORK = {
'ALLOWED_VERSIONS': ['default', 'v1', 'v2'],
'DEFAULT_PAGINATION_CLASS':
'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 100,
'PAGE_SIZE': 1e7,
'DEFAULT_THROTTLE_CLASSES': (
'api.throttling.BurstAnonRateThrottle',
),
......
......@@ -286,6 +286,7 @@ class SupereventUpdateSerializer(SupereventSerializer):
# We don't want to use the SupereventSerializer's validate method,
# which is why we use that class in the super() call here
data = super(SupereventSerializer, self).validate(data)
preferred_event = data.get('preferred_event')
# Only pass through attributes which are being changed
......@@ -323,6 +324,16 @@ class SupereventUpdateSerializer(SupereventSerializer):
updater = getattr(request, 'user', None)
instance = update_superevent(instance, updater, add_log_message=True,
issue_alert=True, **validated_data)
# In some cases when updating a superevent, the user can get an outdated
# version of the gw_events and external_events list from older instance
# of the superevent view. Note that this is only for the httpresponse and
# not the igwn-alert. This clears out the attributes that were previously
# fetched and stored in memory so that when sending the httpresponse, the
# the serializer makes an updated database pull:
for attr in ['external_events', 'internal_events']:
delattr(instance, attr)
return instance
......
......@@ -38,8 +38,8 @@ class MainSearchForm(forms.Form):
QUERY_TYPE_EVENT = 'E'
QUERY_TYPE_SUPEREVENT = 'S'
QUERY_TYPE_CHOICES = (
(QUERY_TYPE_EVENT, 'Event'),
(QUERY_TYPE_SUPEREVENT, 'Superevent'),
(QUERY_TYPE_EVENT, 'Events'),
(QUERY_TYPE_SUPEREVENT, 'Superevents'),
)
FORMAT_CHOICE_STANDARD = 'S'
FORMAT_CHOICE_FLEXIGRID = 'F'
......@@ -51,9 +51,17 @@ class MainSearchForm(forms.Form):
)
query = forms.CharField(required=False, widget=forms.TextInput(
attrs={'size': 40, 'style': 'width:85%'}))
attrs={'size': 40,
'class': 'form-control',
'placeholder': 'Enter query (e.g. O4 gstlal)'
}
))
query_type = forms.ChoiceField(required=True,
choices=QUERY_TYPE_CHOICES, label="Search for", initial='S')
choices=QUERY_TYPE_CHOICES, label="Search for", initial='S',
widget=forms.Select(
attrs={'class': 'form-control',
'style': 'width:fit-content;'}
))
get_neighbors = forms.BooleanField(required=False,
help_text="(Events only)")
results_format = forms.ChoiceField(required=False, initial='S',
......
......@@ -5,7 +5,40 @@
{% block pageid %}search{% endblock %}
{% block content %}
<p>Test and MDC events and superevents are not included in the search results by default. See the query help (link below) for information on how to search for events and superevents in those categories.</p>
<p>
Use this form to query candidate events and superevents in GraceDB. Please refer to
the <a href="/documentation/queries.html" target="_blank">Query Help Documentation</a>
for assistance. Test/MDC events and superevents are not included in the search
results by default.
</p>
<div class="container" style="width:85%">
<form method="GET" name="search_form">
<div class="form-group">
{{ form.query.errors }}
<label for="{{ form.query.id_for_label }}">Query:</label>
{{ form.query }}
</div>
<div class="form-group">
{{ form.query_type.errors }}
<label for="{{ form.query_type.id_for_label }}">Search For:</label>
{{ form.query_type }}
</div>
<div class="form-group">
{{ form.get_neighbors.errors }}
{{ form.get_neighbors }}
<label for="{{ form.get_neighbors.id_for_label }}">Get Event Neighbors</label>
</div>
<input type="Submit" value="Search" class="searchButtonClass btn btn-sm btn-primary">
</form>
</div>
<br>
<br>
{% if message_text is not None %}
......@@ -15,14 +48,6 @@
{% endif %}
<form method="GET" name="search_form">
<table width="100%">
{{ form.as_table }}
<tr><td></td><td><input type="Submit" value="Search" class="searchButtonClass btn btn-sm btn-primary"></td></tr>
<tr><td></td><td><a href="/documentation/queries.html" target="_blank">Query help</a></td></tr>
</table>
</form>
<!-- Search results table -->
{% if query_type == 'S' %}
<table id="flex_superevents"></table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment