summaryrefslogtreecommitdiff
path: root/postgresqleu/util/backendviews.py
AgeCommit message (Collapse)Author
2024-12-03Fix column filters for "copy from previous conference"Magnus Hagander
The contents of the dropdown in the filter was taken from the conference they are being copied *to*, but the contents of the list is the objects from the conference being copied *from*. This mostly shows up when copying sessions, when filtering by track or room makes most sense -- and would be wrong if the track/rooms didn't exist in the new conference.
2024-05-06Add ability to copy linked objects in backend formsMagnus Hagander
And use this to make it possible to copy individual sponsorship benefits inside a conference.
2024-01-21Handle database level constraint errors in backend editorMagnus Hagander
Backend editor would just crash if we failed to save due to a database level constraint (foreign key, unique etc), even if said constraint was defined in django (not for foreign keys as they drive dropdowns, but django does not validate uniqueness, and there could always be a CHECK constraint as well). So trap any such exceptions when trying to save and just show the full error message to the user, instead of crashing.
2024-01-19Show exception when failing to render previewMagnus Hagander
Previews are only used in the backend, so showing a more low level error message there is better than showing nothing at all.
2024-01-17Make actual assignment of assignable column overridableMagnus Hagander
In doing so, allow for the override function to raise a ValidationError on an individual object, in which case this object is not updated and the error is shown to the user, but other objects are still processed.
2024-01-17Support assigning values that are not related or boolsMagnus Hagander
Previously only booeans and related objects (through foreign keys) worked. With this we now also support generic integer fields, such as a choice field that comes from a static list instead of a related model. As a bonus, this now only does the lookup once per call instead of once per row.
2024-01-17Fully validate fields when using multi-assignMagnus Hagander
Previously there was a way for an admin to inject modifications of fields that shoulnd't be there, by manipulating the POST. Only admins, but nevertheless it should be validated - and now also gives a correct error message instead of a crash...
2024-01-04Add a loud warning about changing OAuth keysMagnus Hagander
Especially that you have to restart the servies that cache them.
2023-11-17Don't try to delete non-existant field in dynaprops on registrationMagnus Hagander
2023-11-03Allow setting both rowclass and rowtitle in backend listsMagnus Hagander
And use this to explain the different colors in the tweet lists.
2023-11-03Add the option queryset_extra_columns to backend listsMagnus Hagander
This adds a field to the .only() part that tells the django ORM which fields to fetch. It's needed when we a columns is indirectly used to display a field, but not actually included. Example of this is the errorcount on tweets, which is now also added by this commit.
2023-10-16Pass a hash to use as cache to all backend list display overridesMagnus Hagander
2023-08-02Support deleting keys in json_form_fieldsMagnus Hagander
If the attribute delete_on_empty is set to True on the Field, and the value submitted from the user is empty, delete the key from the json object instead of setting it to the empty string. The default behaviour remains the previous one, which is set the key explicitly to the empty string.
2023-06-14Allow custom submit buttons to return a HttpResponseMagnus Hagander
And if they do, return this immediately instead of continuing to process the submit.
2022-11-05Change from allow_save to disallow_save in form templateMagnus Hagander
These templates are included from other places, so making the default be having a save button reduces the amount of changes required elsewhere.
2022-11-05Support backend forms without a save buttonMagnus Hagander
Sometimes we use the backend forms just to render a view of the data, so in this case we want the Save button completely removed instead of existing-but-not-working.
2022-08-15Create a base class for before-new-object-formsMagnus Hagander
Pass the current conference (if any) to this base class, and make it available to subclasses. Doing this as a proper baseclass makes further additions later easier.
2022-06-26Support higher resolution speaker photosMagnus Hagander
This adds a new field to the speaker model supporting 512x512 sized speaker photos. It also changes the speaker form (as well as the backend form) to accept any size image and resize it into the bounding box of 512x512. There is no reason to force the speaker to do that manually, computers are good at such things. The rezied image will be padded as necessary to the full 512x512 with transparent background, which also means the storage format of the new photos will be PNG in order to support that transparency. Whenever the photo is updated, a downscaled copy will automatically be generated that's 128x128 for backwards compatibilty as well as thumbnailing. There is no interface to independently edit this lower resolution photo. Fixes #15
2021-02-16Don't pass formnote into newform viewingDavid Micallef
"newform" is the special view that's only used for the "you need a small form before you get to the big form for new records", and doesn't require the inheritance that gives formnote. This was mistakenly included in 83bb11653 (which correctly did it for the regular forms)
2020-07-11Add a post_save method to backendformsMagnus Hagander
This method gets called after the form instance has been saved, allowing actions to be taken inside the context of the form.
2020-07-11Pass through a note through backendforms to the templatesMagnus Hagander
By specifying formnote, a note can be added to each form. This could already be done for explicit forms, but not for the managed backendforms.
2020-05-18Complete overhaul of social media integrationsMagnus Hagander
* Remove the hard-coded twitter implementation and replace it with an infrastructure for pluggable implementations. * Separate out "social media broadcasting" (public twitter posts) from "private notifications" (DMs) and invent "private broadcasting" (notifications sent only to attendees of a conference) and "organisation notifications" (sent to organisers). * Add the concept of a Messaging Provider that's configured on a Conference Series, which maps to a twitter account (or similar in other providers). Replace "incoming twitter active" flag on a conference with a setting on this messaging provider for "route messages to conference". This way the messaging doesn't have to be reconfigured for each new conference in a series, and we also automatically avoid the risk of having two conferences getting the same input. * For each conference in a series, the individual Messaging Providers can be enabled or disabled for the different functionality, and individual channels be configured when applicable. * Add implementations of Twitter (updated, social broadcasting and private messaging support), Mastodon (social broadcasting and private messaging) and Telegram (attendee boadcasts, private notifications, and organisation broadcasts) * Add webhook support for Twitter and Telegram, making for much faster reactions to incoming messages. * Hardcoded news twitter post accounts, and replaced with MessagingProviders per above that are not attached to a conference. * Add a daemon that listens to PostgreSQL notifications and sends out broadcasts and notifications for quicker action (if not enabled, a scheduled task will send them out every 10 minutes like before) * In making broadcast posts, add support for the fact that different providers have different max length of posts (e.g. Twitter currently has 280 and Mastodon 500), and also roughly account for the effects of URL shorterners on posts. * Add a button to registration dashboards to send DMs to attendees that have configured notification. * Send "private broadcasts" ahead of any talks to keep people posted of talks. For now this is always enabled if a channel is set up for private broadcasts, we may want to consider making it more configurable in the future. There are still a lot of tables and files referring Twitter in the tree, and some of those will be renamed in a future commit to make tracking of changes easier. Fixes #29 Fixes #13
2020-05-11Allow speicying an object_queryset in backend list editorsMagnus Hagander
For forms that are not bound to a conference, make it possible to speicfy a custom queryset instead of using the object default one, thereby being able to add custom filtering.
2020-05-11Pass and store request in backend formsMagnus Hagander
This makes it possible to use it to for example indicate messages in the django messaging framework from inside methods in the class
2020-05-11Add field and widget to support a custom submit button in backend formsMagnus Hagander
This form will not do a regular save, and instead call a callback function defined on the field.
2020-04-23Allow overriding of model verbose names in backend formsMagnus Hagander
2019-12-21Allow a model to prevent the backend editors from deleting itMagnus Hagander
By definiting a method called validate_object_delete, the model can raise a ValidationError which will act the same way as an object attached via a foreign key in how it prevents the deletion of the object.
2019-10-29Remove support for file_fields hack in backend formsMagnus Hagander
This has now been replaced with proper PDF and Image upload fields, so the hack is not needed anymore.
2019-08-26Fix copying of objects with extra querysets in adminMagnus Hagander
The addition of the extra queryset has to happen both on regular view and copy view. This was missed in aa6b6d5772c9e77f7ac43229a9f5db22bf9eb68a
2019-08-21Make the backend list editor more efficient wrt fields being loadedMagnus Hagander
Only load the fields from models that are actually needed. This can in particular be efficient when loading models with large text or image fields. Also make it possible for a backend form to specify which related objects to select with a join instead of a loop.
2019-08-21Add ability to add a CSS class to each individual row in backend listsMagnus Hagander
2019-08-08Make defaultsort specify column names instead of numbersMagnus Hagander
This is a lot less error-prone. While at it, fix a couple of sortings that could be done better.
2019-08-07Allow bulk assignment of rooms and cross schedule for sessionsMagnus Hagander
2019-07-11Add backend form for editing conference speakersMagnus Hagander
This makes it possible for a conference administrator to edit the speakers that have submitted a talk to their conference. It doesn't allow for adding new speakers (due to the requirement on the speaker having a user account) or deleting them.
2019-07-11Add a conference_queryset to backend form meta classMagnus Hagander
If this is defined, it will be used instead of limiting on the field conference explicitly. This can be used for example to limit the list of objects to one that is reached through a foreign key relationship via another object and not directly to the conference itself.
2019-03-27Add the concept of test/validate to invoice payment formsMagnus Hagander
This adds a button which can be clicked to validate the current settings, at which point it will do an ajax pingback to get data and then replace itself with that.
2019-01-26Fix missing importsMagnus Hagander
2019-01-15Don't try to save readonly fieldsMagnus Hagander
normally they would be unchanged, but by not even trying to save them, we can also get away with not specifying them.
2019-01-14Fix title and name of buttons for form_before_newMagnus Hagander
We are not editing an item, we are creating it.
2019-01-10Generic changes for python3 from 2to3Magnus Hagander
2019-01-09Reimplement sponsorship benefit configuration using json formsMagnus Hagander
Instead of having to type everything in as json, render proper fields with proper form based validation.
2019-01-09Add support for dynamic forms for json fieldsMagnus Hagander
This makes it possible to have some regluar form fields render into a json field instead of into separate columns, within the framework of the backend forms. This can be used to replace (some of) the fields that requires manual json input (as long as the expected structure is simple) with proper form fields.
2019-01-03Add buttons for email to individual attendees and sessionsMagnus Hagander
The basic functionality was already there in the form of the ability to pick the attendee or session in the list and click "send email to 1 <attendee|speaker>". This just adds a button once the session or attendee is open that goes to the same form for sending the email.
2018-12-27Make it possible to override object ordering in backend listsMagnus Hagander
2018-12-23Fix pep8 warnings from previous commitsMagnus Hagander
2018-12-20Make it possible to assign values to multiple entries in one goMagnus Hagander
Initially, use this to make it possible to set the same track to multiple sessions (often requested..) or to set the registration class on multiple registration types. Framework is generic though, and can be used for many more.
2018-12-19Add support for emailing individual attendeesMagnus Hagander
* Add the ability to track emails against individual attendees and not just registration classes. * Add the ability to track emails to users who are not yet registered (but they must have a user account as that's what we track against). These emails gets automatically attached to the registration once the user registers. * Add support to the registration dashboard listing for ticking of attendees to send email to, and to send it. * Add generic support to the admin backend for the same, and enable this support for sessions (more can be adde din the future). * Change the admin list of emails to collapse when there are many emails sent, and not overflow the screen. This as it's more likely that many emails are sent now. Create a file called admin.js for this -- more should probably be migrated over to this file instead of living in individual HTML files, but that's for a later commit.
2018-12-18Add filtering to generic backend viewsMagnus Hagander
This enables client side filtering of values using hte datatable plugin that we already had. Especially interesting for the list of registrations which can now be filtered based on things like status and track.
2018-12-16Fixed linked objects for non-conference formsMagnus Hagander
2018-12-16Add backend editors for news and news author profilesMagnus Hagander