Magnus Hagander [Wed, 4 Sep 2024 15:16:04 +0000 (17:16 +0200)]
Add missing import
Magnus Hagander [Tue, 3 Sep 2024 14:01:21 +0000 (16:01 +0200)]
Fix cancellation of invoices manually flagged as paid
This is not a normal situation and has to be dealt with manually
regardless, but we shouldn't crash on it prior to telling the user they
have to do that...
Magnus Hagander [Tue, 3 Sep 2024 13:55:52 +0000 (15:55 +0200)]
Fix dumb typo in attribute name
This caused an error in the view when setting up a new oauth client
(such as a linkedin page). It happened *after* the actual configuration
was completed, so one just had to reload for things to work, but it
still shouldn't error like that.
Magnus Hagander [Wed, 21 Aug 2024 15:04:07 +0000 (17:04 +0200)]
Clarify status of pending attendee emails
Separate out "not sent yet" from "not supposed to be sent yet".
Magnus Hagander [Wed, 21 Aug 2024 15:32:28 +0000 (17:32 +0200)]
Remove unused import
Magnus Hagander [Wed, 21 Aug 2024 11:47:55 +0000 (13:47 +0200)]
List which fields are available when building tweet templates
Both for sponsor benefits and for campaign creation, list which fields
are available to use in the Jinja templates, to make it easier to figure
out how to use them.
Magnus Hagander [Wed, 21 Aug 2024 11:35:38 +0000 (13:35 +0200)]
Mark some missing unsafe attributes
Magnus Hagander [Wed, 21 Aug 2024 11:35:00 +0000 (13:35 +0200)]
Add function to get list of (sandbox approved) attributes from classes
Magnus Hagander [Wed, 21 Aug 2024 11:33:11 +0000 (13:33 +0200)]
Add some generic useful templatetags to identify types
Magnus Hagander [Wed, 21 Aug 2024 11:32:37 +0000 (13:32 +0200)]
Add a widget to show a simple treeview
Magnus Hagander [Fri, 9 Aug 2024 15:48:42 +0000 (17:48 +0200)]
Add a form control for previewing HTML
This uses (partially) the pgweb code for loading previewable HTML into
an iframe sandbox.
Magnus Hagander [Tue, 20 Aug 2024 15:36:04 +0000 (17:36 +0200)]
Remove debugging code accidentally left in
Magnus Hagander [Tue, 20 Aug 2024 08:33:48 +0000 (10:33 +0200)]
Indicate if a benefit has expired in the sponsor overview matrix
Magnus Hagander [Tue, 20 Aug 2024 08:33:16 +0000 (10:33 +0200)]
Add a template tag to access an array by index
For some reason, django won't let us do that from a template, so we have
to add our own.
Magnus Hagander [Mon, 19 Aug 2024 13:23:42 +0000 (15:23 +0200)]
Remove support for templtaes in attendee emails
This was accidentally broken in
52fa57dc, and went mostly unnoticed. It
was only used by signup emails which now ended up having just one link
instead of two, so it seems fine for now. We'll eventually want to add
more smarness to the templates around this, but that can't be done
without a bigger surgery so for now just remove it.
Magnus Hagander [Mon, 19 Aug 2024 11:15:05 +0000 (13:15 +0200)]
Remove dependency on pgcrypto
pgcrypto was only used to set tokens in some migrations,
so in practice it should not actually be UPDATEing any
rows anymore (there should either be no rows, or they're
all updated by now). Once the migration has completed,
all new tokens are set from the python code.
So update the migrations to use the build-in random() function instead,
which is "good enough for this usage", and thereby dropping the
dependency on pgcrypto making new installs easier.
Magnus Hagander [Mon, 19 Aug 2024 10:49:19 +0000 (12:49 +0200)]
Remove extra period.
Magnus Hagander [Fri, 9 Aug 2024 15:49:15 +0000 (17:49 +0200)]
Fix typo
Dan Langille [Fri, 9 Aug 2024 01:22:16 +0000 (01:22 +0000)]
django.conf.urls.url() was deprecated in Django 3.0, and was removed in
Django 4.0
Magnus Hagander [Tue, 6 Aug 2024 11:02:09 +0000 (13:02 +0200)]
Use send_conference_simple_mail for conference related mail
Magnus Hagander [Tue, 6 Aug 2024 11:01:16 +0000 (13:01 +0200)]
Remove unusd import
Magnus Hagander [Tue, 6 Aug 2024 11:00:54 +0000 (13:00 +0200)]
Make confwiki send notifications using send_conference_notification
Magnus Hagander [Mon, 5 Aug 2024 12:00:57 +0000 (14:00 +0200)]
Calculate, store and use etags on speaker photos
This allows us to return 304 not modified for speaker photos, as they
change very infrequently. Actual etag is maintained as an md5() of the
contents, by a database trigger the same way we do for util/storage
fields.
Magnus Hagander [Tue, 30 Jul 2024 14:02:59 +0000 (16:02 +0200)]
Fix invalid option passing
Magnus Hagander [Tue, 30 Jul 2024 14:01:50 +0000 (16:01 +0200)]
Allow overriding how far back to fetch Wise transactions
Magnus Hagander [Tue, 23 Jul 2024 13:02:11 +0000 (15:02 +0200)]
Fix query for nagios alerts on unsent social media broadcasts
As of
45b8e2e9, we update the sent column to be True while leaving
unsent providers in the linked table (so we can keep track of which
succeeded and which failed). The nagios check never got the memo about
that one, so it didn't check the sent column, only the linked table,
when in fact it's now enough to *just* check the sent column. So do
that.
Magnus Hagander [Mon, 22 Jul 2024 17:49:09 +0000 (19:49 +0200)]
Check instance.pk, not instance.id, for members get_list
Commit
f2baae524 added a guard on instance.id to all get_list calls. For
Members that was technically not needed since there is currently no
interface to manually add a member, but it was added for consistency and
future-proofing. But since the Member object doesn't have its own
primary key, it would instead cause a crash. So - change it to look at
the `pk` field which does exist.
Reported by Stacey Haysler, diagnosed by Christophe Pettus
Magnus Hagander [Mon, 22 Jul 2024 12:42:53 +0000 (14:42 +0200)]
Fix typo that caused message token refresh to never run in background
Magnus Hagander [Mon, 1 Jul 2024 10:38:12 +0000 (12:38 +0200)]
Allow comma directly after batch number when matching adyen payouts
Magnus Hagander [Wed, 26 Jun 2024 15:31:47 +0000 (17:31 +0200)]
Show social media post status per network even for single text posts
Previously we'd just show a boolean "posted" or "not posted" based on if
there was more than one version of the text. But it's actually
interesting to know if it's posted to only some of the networks even if
the exact same text is posted to all of them, so make it show that in
all cases.
Magnus Hagander [Tue, 25 Jun 2024 14:08:54 +0000 (16:08 +0200)]
Cache inactive messaging providers when viewing the queue
Without this, if a provider goes from active -> inactive when there are
existing posts, we'd crash the view of the existing ones.
Magnus Hagander [Tue, 25 Jun 2024 14:05:56 +0000 (16:05 +0200)]
Make it possible to confirm sponsor benefits without triggering social media
For example if a sponsor needs to re-claim something because they sent
the wrong data, we don't want to trigger a second post.
Magnus Hagander [Tue, 25 Jun 2024 13:52:42 +0000 (15:52 +0200)]
Don't render broken image tags for declined benefits
Magnus Hagander [Tue, 25 Jun 2024 13:49:02 +0000 (15:49 +0200)]
Add a preview step when sponsors upload images
When a sponsor uploads an image, show them a preview of what they
actually uploaded and require confirmation of it. In particular, render
this preview on a background color if configured, same ast he admin
preview.
Magnus Hagander [Tue, 25 Jun 2024 13:46:07 +0000 (15:46 +0200)]
Add ability to do preview-on-background on uploaded images
This allows the admin to configure a color to use as preview background
for the image upload sponsor benefit. Particularly useful for allowing
the previewing the transparency of an image to be used no a website
that has a non-white background,.
Magnus Hagander [Tue, 25 Jun 2024 13:35:29 +0000 (15:35 +0200)]
Move color_validator to shared file
Magnus Hagander [Tue, 25 Jun 2024 10:06:27 +0000 (12:06 +0200)]
Replace newline with <br/> in signwell messages
When attaching a message to a contract, it looksl ike Signwell accepts
html (the format isn't really documented), so this is a way to make the
message a lot nicer.
Magnus Hagander [Tue, 25 Jun 2024 09:57:42 +0000 (11:57 +0200)]
Don't ask for manager when sending manual additional contracts
We don't use the manager anyway, we send it to all -- and the help text
already said we do, but the field was still in the form.
Magnus Hagander [Mon, 24 Jun 2024 14:28:09 +0000 (16:28 +0200)]
Add exact error times to Mastodon poll times
Anything to find a pattern.
Magnus Hagander [Mon, 24 Jun 2024 14:19:13 +0000 (16:19 +0200)]
Add a default value for GOCARDLESS_COUNTRY
Magnus Hagander [Mon, 24 Jun 2024 14:11:42 +0000 (16:11 +0200)]
Disable persistent connections for Mastodon provider
Perhaps it's the use of multiple parallel persistent connections that
breaks mastodon.social? Who knows, but it's worth a try since we don't
really make any useful use of the persistent connections anyway.
Magnus Hagander [Mon, 24 Jun 2024 13:56:36 +0000 (15:56 +0200)]
Add payment provider for Gocardless bank account data
They provide a service similar to Plaid but better layed out for small
organisations (in Europe at least) for now. Let's see how long that
lasts, but for now here's a basic provider that works very similar to
the Plaid one, except it does not support webhooks.
Magnus Hagander [Fri, 21 Jun 2024 19:27:51 +0000 (21:27 +0200)]
Don't try to post empty content on multiprovider tweets
When rendering multiprovider tweets, if there is no messaging at all
defined, we get no text, and that's normal. However, when then also need
to check for no text at all in the posting side of things *before* we
check for providers, or we will violate a database constraint.
Of course, one should define tweet templates when there is no messaging
configuration, but we should also not crash if it's done.
Spotted by Karen Jex
Magnus Hagander [Fri, 21 Jun 2024 17:06:54 +0000 (19:06 +0200)]
Fix typo
Magnus Hagander [Fri, 21 Jun 2024 15:34:24 +0000 (17:34 +0200)]
Plaid no longer supports a development environment, change default
Magnus Hagander [Wed, 19 Jun 2024 15:21:06 +0000 (17:21 +0200)]
Make deadlines even more clear on the sponsor dashboard
Bold, and write it in two places. Also, specify the exact timezone.
Magnus Hagander [Wed, 19 Jun 2024 14:51:47 +0000 (16:51 +0200)]
Trap exceptions when posting to social media
The providers themselves would catch some exceptions and turn them into
proper error messages, but for the cases where they don't, we want the
loop in the sender to do so for us and just log the exception message.
Magnus Hagander [Tue, 18 Jun 2024 15:22:51 +0000 (17:22 +0200)]
Allow re-sending contracts to instant buy levels
These levels by definitoin don't need a contract, but some sponsors
still want it...
Magnus Hagander [Sun, 16 Jun 2024 14:25:24 +0000 (16:25 +0200)]
Make it possible to have some benefits not included in token data
Magnus Hagander [Sun, 16 Jun 2024 14:17:51 +0000 (16:17 +0200)]
Fix typo
Magnus Hagander [Sun, 16 Jun 2024 13:51:45 +0000 (15:51 +0200)]
Render linebreaks in multi-line text sponsor benefits
We'll want to look into markdown support at some point, but as a
quickfix at least render newlines in large texts.
Magnus Hagander [Sun, 16 Jun 2024 12:11:42 +0000 (14:11 +0200)]
Add basic rate limiter for Mastodon API calls
It seems at leaast mastodon.social may have implemented rate limiting at
the TCP level (afaict). To work aroud this, implement a 15 second rate
limit for Mastodon API calls to individual providers (allow other calls
to go quicker). As this is done per-process it only affects batch jobs,
but those are also the only ones with the issue.
Uncertain if this will actually work since the limit isn't documented
(unlike the http level limit), but it's worth a try.
Magnus Hagander [Fri, 14 Jun 2024 08:53:39 +0000 (10:53 +0200)]
Always sort benefits by id in token based json update
This can otherwise lead to weird diffs in downstream projects that pull
it down, when unordered data changes.
Magnus Hagander [Tue, 11 Jun 2024 08:28:21 +0000 (10:28 +0200)]
Stop referring to "new style jinja root"
This hasn't been new style for many many years, and there is only one
style supported anyway. (Change only to help text)
Magnus Hagander [Thu, 6 Jun 2024 20:55:46 +0000 (22:55 +0200)]
Teach sponsor VAT validation about the Greece exceptoin
Other than validating the VAT number (which worked), we also ensured the
first two characters were the ISO code of a valid country. Turns out
this only applies to all other countries thant Greece -- Greece uses EL
which is not a valid country code. So map the Greece exception to the
Greece country code, thus allowing signups from there.
Magnus Hagander [Thu, 6 Jun 2024 20:42:48 +0000 (22:42 +0200)]
Accept paypal code T0700 as a payment
This is one never seen before and seems to be used for shipping labels.
Bring it in and treat it like any other.
Noted by Christophe Pettus, but not his patch - going for a minimalistic
one. This code may need some further refactoring down the road.
Magnus Hagander [Thu, 30 May 2024 20:36:38 +0000 (22:36 +0200)]
Actually sort the tracks by the tracks sort key in the cfp form
Previously it was only used in the backend, not in the cfp form, which
is just wrong.
Magnus Hagander [Thu, 30 May 2024 18:59:32 +0000 (20:59 +0200)]
Return sponsors inside level in predictable order in tokendata
It doesn't really matter which order as the receiver is supposed to sort
it by whatever their rules are, but we should at least make it
predictable so we don't generate unnecessarily large diffs.
Magnus Hagander [Tue, 28 May 2024 20:03:52 +0000 (22:03 +0200)]
Add a class to conference feedback fieldsets
Magnus Hagander [Tue, 28 May 2024 16:15:30 +0000 (18:15 +0200)]
Trap and handle really invalid URLs from sponsor signup
If a URL is *really* invalid, we could crash with an exception instead
of showing a form error.
Magnus Hagander [Fri, 24 May 2024 21:21:03 +0000 (23:21 +0200)]
Fix attendee emails for direct-recipient addressing
Magnus Hagander [Wed, 22 May 2024 20:04:27 +0000 (22:04 +0200)]
Clearly sort unconfirmed sponsors by signup date
Magnus Hagander [Wed, 22 May 2024 20:00:53 +0000 (22:00 +0200)]
Teach fetch_sponsorfiles.py to optionally add downloaded files to git
Magnus Hagander [Wed, 22 May 2024 12:19:41 +0000 (14:19 +0200)]
Fix copy/paste error
Magnus Hagander [Wed, 22 May 2024 11:53:22 +0000 (13:53 +0200)]
Fix typo
Magnus Hagander [Mon, 20 May 2024 19:23:07 +0000 (21:23 +0200)]
Show error when trying to set value to non-existant dynamic field
When no dynamic field at all exists, the list is empty string. Which
python splits into an array of a single empty string, which would then
allow us to try to set the value on a field with no name (which of
course didn't work, but failed silently). So instead fail with a proper
error message.
Spotted by Melanie Plageman
Magnus Hagander [Sun, 19 May 2024 18:03:21 +0000 (20:03 +0200)]
Send notification when secondary speaker is added during cfp
When speaker A adds speaker B as a co-speaker of a session, send a
notification to speakear B about this so they're not surprised by it.
This only happens during the cfp process, not if admins make changes in
the backend (and per that it cannot happen after the cfp has closed).
Suggested by Karen Jex
Magnus Hagander [Sat, 18 May 2024 09:57:45 +0000 (11:57 +0200)]
Implement max submission count in call for papers
This makes possible to optionally restrict how many submissions someone
can make to a conference call for papers.
Fixes #70
Magnus Hagander [Sat, 18 May 2024 08:28:18 +0000 (10:28 +0200)]
Implement messaging config validation for Mastodon
This was clearly missed when Mastordon support was added, and is pretty
trivial to do - we just need to try to fetch our own account info (like
we already do on twitter)
Magnus Hagander [Sat, 18 May 2024 08:23:43 +0000 (10:23 +0200)]
Add basic Linkedin messaging provider
For now, this provider only supports basic publishing of entries as
post. It does not support any polling, and it does not support
collecting sponsor/speaker id's and highlighting them in notices. This
can be added later, but it can't be done properly without linkedin app
credentials that are not rate limited (the default), and you can't get
those credentials without already having an app.
As linkedin doesn't support the offline code flow for logins, this also
implements an oauth endpoint for incoming oauth flows for messaging
provider.
Finally, unlike the other messaging providers, linkedin actually expire
their oauth tokens - 2 months for the access token and 12 months for the
refresh token. To handle that, implement token refresh as part of the
validation flow, and simply flag that one as failed if the login doesn't
work.
Magnus Hagander [Sat, 18 May 2024 07:51:53 +0000 (09:51 +0200)]
Fix scheduling of message integration checker
This time schedule for this integration was incorrectly configured,
resulting in it not being scheduled at all by default.
Magnus Hagander [Thu, 16 May 2024 21:02:38 +0000 (23:02 +0200)]
Add ability for social media providers to specify help for fields
Magnus Hagander [Thu, 16 May 2024 21:01:06 +0000 (23:01 +0200)]
Make it possible to filter social media fields per source
This allows a media provider to for exapmle say that it can only
register sponsor accounts, not speaker accounts. All existing
implementations support all kinds of registrations, but it's
infrastructure for the future.
Magnus Hagander [Thu, 16 May 2024 19:26:49 +0000 (21:26 +0200)]
Fix typo
Magnus Hagander [Thu, 16 May 2024 19:10:18 +0000 (21:10 +0200)]
Remove unused import
Magnus Hagander [Thu, 16 May 2024 10:18:41 +0000 (12:18 +0200)]
Fix typo
Magnus Hagander [Thu, 16 May 2024 09:11:58 +0000 (11:11 +0200)]
Fix indentation error from copy/pasting text for sponsor emails
The actual emails going out were correctly indented, but the
notification to admins that it had been sent had a weird mix.
Magnus Hagander [Tue, 14 May 2024 18:24:17 +0000 (20:24 +0200)]
Add ability to schedule attendee emails for the future
This includes both direct attendee emails, and also those that are for
example sent to speakers of a session. This also removes the support for
sending such emails *without* storing them as attendee emails, as that
wouldn't leave us with a way to track what's been sent and what hasn't.
Fixes #90
Magnus Hagander [Tue, 14 May 2024 14:17:36 +0000 (16:17 +0200)]
Add ability to schedule confsponsor emails for the future
Start proper work on #90, but is not complete yet
Magnus Hagander [Tue, 14 May 2024 13:03:05 +0000 (15:03 +0200)]
Add ability to low-level queue emails in the future
Most of the system won't be using this, but it's still good to have for
completeness sake.
Magnus Hagander [Tue, 14 May 2024 12:12:24 +0000 (14:12 +0200)]
Track regtime separate from sendtime on queued emails
The regtime is always set to the extact time that an email was added. If
a different sendtime is specified, it's still good to be able to track
when something was added to the queue.
Magnus Hagander [Tue, 14 May 2024 12:07:34 +0000 (14:07 +0200)]
Disable USE_L10N
This is default on in Django 4.2, but that makes it sometimes pick a
different default date format thatn we normally want. Since we want to
be in full control of that, turn off this in django.
Magnus Hagander [Tue, 14 May 2024 12:02:26 +0000 (14:02 +0200)]
Fix typo
Magnus Hagander [Tue, 14 May 2024 11:46:20 +0000 (13:46 +0200)]
Complete the sendtime handling for mailqueue
Sync up the "warning button" filtering with that of the alerts, which
means we don̈́'t alert for emails that aren't supposed to be sent yet.
This becomes more relevant as we also stop trying to send emails that
are set to be sent in the future, in preparation for upcoming
functionality to schedule email sending.
Magnus Hagander [Mon, 13 May 2024 08:21:19 +0000 (10:21 +0200)]
Sync up old migrations after django 4.2 update
Seems django 4.2 reqiures some fields to be defined slightly differently
for the same thing. Backpatch this into the old migrations, as there are
no actual changes to the models or to the result of the migration.
Magnus Hagander [Mon, 13 May 2024 08:19:46 +0000 (10:19 +0200)]
Put a default of "no database" into the github checks
This removes the confusing warning about trying to contact the database
to check migration consistency, since we don't want that check anyway.
Magnus Hagander [Sun, 12 May 2024 09:08:15 +0000 (11:08 +0200)]
Add instance.id check to get_list() calls in backend editor
Some get_list() implementations for backend editors did not properly
check that the instance they were passed actually existed, and could
crash if it didn't (most prominent example being the the
sessions<->slides link). Some of these are can't-happen (because the
object doesn't support adding new empty ones), but this commit adds a
guard to those as well just to be on the safe sid for future changes.
Magnus Hagander [Sun, 12 May 2024 09:04:27 +0000 (11:04 +0200)]
Fix incorrect field access when reloading a stripe payment page
Typical case is if an invoice is open for payment in two different tabs,
it's then paid in one tab and then reloaded in the other, the Strip
integration would crash because it accessed the wrong field. This has
been wrong since day one of the Strip integration, so the comment
stating it won't "normally happen" was entirely correct...
Magnus Hagander [Thu, 9 May 2024 16:49:21 +0000 (18:49 +0200)]
Fix bad field name twice more
The bug fixed in
35355999 was copy/pasted to two more places, that the
bugfix missed.
Magnus Hagander [Thu, 9 May 2024 06:05:43 +0000 (08:05 +0200)]
Fix invalid field name in select_related
Magnus Hagander [Thu, 9 May 2024 06:05:12 +0000 (08:05 +0200)]
Fix attempt to deference many2many before pk exists
Magnus Hagander [Wed, 8 May 2024 16:14:39 +0000 (18:14 +0200)]
Update devrequirements to Django 4.2
Magnus Hagander [Wed, 8 May 2024 15:08:04 +0000 (17:08 +0200)]
Don't try to access invoice history before invoice exists
Magnus Hagander [Wed, 8 May 2024 14:13:49 +0000 (16:13 +0200)]
Fix field selection for messaging provider in sender
The messaging field is directly on the queue object, not on the
registration (unlike the messaging config field). Django 3.2 would
ignore this incorrect fetch and just work (but without getting the
field, so causing an extra query). Django 4.2 throws an error.
Magnus Hagander [Wed, 8 May 2024 13:43:23 +0000 (15:43 +0200)]
Switch from pytz to zoneinfo for timezone data
This is deprecated in newer Django, and will be removed in 5.0. We're
using only very little of the library functionality directly, and the
rest of it's already i django, and since Django 4.2 switched the primary
library, we switch as well for it.
Magnus Hagander [Wed, 8 May 2024 10:18:23 +0000 (12:18 +0200)]
Fix sponsor benefit tweet preview when no messaging providers exist
Instead of just returning "None", return a short descriptive text
telling the user *why* the preview is not available.
Magnus Hagander [Wed, 8 May 2024 08:48:13 +0000 (10:48 +0200)]
Update signal syntax for django 4.2
Magnus Hagander [Mon, 6 May 2024 14:15:32 +0000 (16:15 +0200)]
Add ability to copy linked objects in backend forms
And use this to make it possible to copy individual sponsorship benefits
inside a conference.
Magnus Hagander [Mon, 6 May 2024 13:14:48 +0000 (15:14 +0200)]
Fix dumb typo in query
Magnus Hagander [Mon, 6 May 2024 13:12:59 +0000 (15:12 +0200)]
Fix ordering of benefits in at-a-glance data
Since three is a sortkey field on the benefit, we should use that to
sort by first.