Fix #708 -- Standardize use of check-in (#711)

* standardize use of check-in

* split on occurrence of "checkin_*"

Instead of skipping when encountering "checkin_*", we now split and only
pass the second part to the spell-checker. This fixes the aforementioned
problem.

* fix spelling issue with checkins
This commit is contained in:
Jakob Schnell
2017-12-21 14:28:33 +01:00
committed by Raphael Michel
parent 5d697a3189
commit 8c0fb90420
8 changed files with 21 additions and 6 deletions

View File

@@ -217,7 +217,7 @@ Endpoints
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/checkinlist/(id)/ .. http:delete:: /api/v1/organizers/(organizer)/events/(event)/checkinlist/(id)/
Delete a check-in list. Note that this also deletes the information on all checkins performed via this list. Delete a check-in list. Note that this also deletes the information on all check-ins performed via this list.
**Example request**: **Example request**:

View File

@@ -1,3 +1,5 @@
.. spelling:: checkins
Orders Orders
====== ======

11
doc/checkin_filter.py Normal file
View File

@@ -0,0 +1,11 @@
from enchant.tokenize import get_tokenizer, Filter, unit_tokenize
class CheckinFilter(Filter):
""" If a word looks like checkin_count, it refers to a so-called variable in
the code, and is treated as being spelled right."""
def _split(self, word):
if word[:8] == "checkin_":
return unit_tokenize(word[8:])
return unit_tokenize(word)

View File

@@ -306,3 +306,7 @@ spelling_word_list_filename='spelling_wordlist.txt'
# Boolean controlling whether suggestions for misspelled words are printed. # Boolean controlling whether suggestions for misspelled words are printed.
# Defaults to False. # Defaults to False.
spelling_show_suggestions=True spelling_show_suggestions=True
# List of filter classes to be added to the tokenizer that produces words to be checked.
from checkin_filter import CheckinFilter
spelling_filters=[CheckinFilter]

View File

@@ -157,7 +157,7 @@ uses to communicate with the pretix server.
.. http:get:: /pretixdroid/api/(organizer)/(event)/status/ .. http:get:: /pretixdroid/api/(organizer)/(event)/status/
Returns status information, such as the total number of tickets and the Returns status information, such as the total number of tickets and the
number of performed checkins. number of performed check-ins.
**Example request**: **Example request**:

View File

@@ -11,8 +11,6 @@ booleans
cancelled cancelled
casted casted
checkbox checkbox
checkin
checkins
checksum checksum
config config
contenttypes contenttypes

View File

@@ -100,7 +100,7 @@ class CheckinList(LoggedModel):
class Checkin(models.Model): class Checkin(models.Model):
""" """
A checkin object is created when a person enters the event. A check-in object is created when a person enters the event.
""" """
position = models.ForeignKey('pretixbase.OrderPosition', related_name='checkins') position = models.ForeignKey('pretixbase.OrderPosition', related_name='checkins')
datetime = models.DateTimeField(default=now) datetime = models.DateTimeField(default=now)

View File

@@ -179,7 +179,7 @@ class Item(LoggedModel):
:type max_per_order: int :type max_per_order: int
:param min_per_order: Minimum number of times this item needs to be in an order if bought at all. None for unlimited. :param min_per_order: Minimum number of times this item needs to be in an order if bought at all. None for unlimited.
:type min_per_order: int :type min_per_order: int
:param checkin_attention: Requires special attention at checkin :param checkin_attention: Requires special attention at check-in
:type checkin_attention: bool :type checkin_attention: bool
""" """